Copy a directory with scp

Copy recursively to a server on a 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 your local SSH agent to the remote host; use with care

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

    Start the agent and load a key for this session

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

    Short alias: "ssh dev" applies all these options

  • ~.

    Press Enter, then type ~ and . to close a hung session

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

    Get the server host keys and show their fingerprints without logging in

all 15 ssh commands