22 / 55 · 19 Linux & Command Line · grep, curl, and jq← prev⊞ allnext →☰ Read as one page
3.7ssh and scp
Remote server access is essential for QA work in non-local environments:
# Connect to a remote server
ssh qa@staging-server.example.com
# Run a command on a remote server without interactive session
ssh qa@staging-server.example.com "ps aux | grep node"
# Copy test results from remote to local
scp qa@staging-server.example.com:/var/log/test-results.xml ./
# Copy file from local to remote
scp test-data.json qa@staging-server.example.com:/tmp/
# SSH tunnel: Access a remote database locally
ssh -L 5432:localhost:5432 qa@staging-server.example.com
# Now connect to localhost:5432 to reach the remote Postgres