Copy file via SCP

Recursive copy on non-standard port

scp -r -P 2222 ./dist/ user@host:/var/www/app/

tool
ssh15 commands
tags
ssh

More ssh commands

  • ssh -A user@bastion

    Forward local SSH agent to the remote host (use with caution)

  • eval $(ssh-agent) && ssh-add ~/.ssh/id_ed25519

    Start agent and load a key for the session

  • cat >> ~/.ssh/config <<'EOF' Host dev HostName 10.0.0.5 User ubuntu IdentityFile ~/.ssh/dev_key ProxyJump bastion EOF

    Shorthand alias: 'ssh dev' triggers all options

  • ~.

    Terminate a frozen/hung SSH session: type tilde then dot

  • ssh-keyscan -t ed25519,rsa host 2>/dev/null | ssh-keygen -lf -

    Fetch and fingerprint server host keys without connecting

all 15 ssh commands