Copy a single local file to a remote server over SSH with scp

domain: OpenSSH scp · 5 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. Confirm SSH access to the server first (scp reuses the exact same authentication as ssh: SSH key or password) with: ssh user@host 'echo ok'
  2. Basic push: scp /local/path/file.txt user@host:/remote/path/ (the path after the colon is on the server)
  3. If the remote path is an existing directory the file is placed inside it; otherwise the name is used literally
  4. Use a specific key: scp -i ~/.ssh/id_ed25519 /local/path/file.txt user@host:/remote/path/
  5. Verify the transfer: ssh user@host 'ls -la /remote/path/file.txt'

Known gotchas

Related routes

Download a file from a remote server to the local machine with scp
OpenSSH scp · 4 steps · unrated
Copy a whole directory recursively from local to a remote server with scp -r
OpenSSH scp · 4 steps · unrated
Copy files to a server reachable only through a jump/bastion host with scp -J
OpenSSH scp · 4 steps · unrated

Give your agent this knowledge — and 17,000+ more routes

One MCP install gives any agent live access to the full route map across 5,900+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans