ssh-keygen -t ed25519 -C "your_email@example.com"This creates two files by default:
~/.ssh/id_ed25519(private key — never share this)~/.ssh/id_ed25519.pub(public key — safe to share)
ssh-copy-id user@remote-hostThis appends your public key to ~/.ssh/authorized_keys on the remote host, enabling passwordless login.
ssh user@remote-hostssh -i ~/.ssh/id_ed25519 -p 2222 user@remote-hostEvery server you connect to gets fingerprinted in:
cat ~/.ssh/known_hostsscp localfile.txt user@remote-host:/home/user/