A frozen session ignores Ctrl+C — press Enter, then ~.: the client drops the connection itself. ~?
lists these escapes. They work only at the start of a line.
Copying
Command
What it does
scp backup.tar.gz web1:/tmp/
file to the server
scp web1:/opt/traefik/data/traefik.yml .
file from the server
scp -3 web1:/tmp/a.tar web2:/tmp/
server to server through your computer
rsync -av --dry-run ./site/ web1:/srv/site/
show what would be sent, change nothing
rsync -av --delete ./site/ web1:/srv/site/
make an exact copy: extra files on the server get deleted
With rsync, a trailing slash on the source decides: ./site/ is the directory’s contents, ./site is the
directory itself, put inside /srv/site/. Start with --dry-run. Since OpenSSH 9.0 scp runs over SFTP;
the old flags still work.
The line Accepted publickey for example-user from … ssh2: ED25519 SHA256:u7WT… carries the key fingerprint, which
tells you which device logged in (SSH keys).