GUIDE 05 / ADMINISTRATION
SSH, keys & agents
Connect securely, copy files, and manage authentication keys.
In this guide
Commands use class paths and example filenames. Replace placeholders and inspect the target before making changes.
Create and install a public key
Generate a key on the client that will connect. Keep the private key on that client. Install only the .pub public key on the remote account.
ssh-keygen -t ed25519 -C "class-client"
ssh-copy-id USERNAME@server.example.com
ssh USERNAME@server.example.com
scp notes.txt USERNAME@server.example.com:~/Choose a new key filename if an existing key is already present. Review host-key fingerprints through a trusted channel before accepting a new server identity.
Use an SSH agent
The agent holds unlocked keys for client authentication. ssh-add -l lists loaded key fingerprints. Starting an agent in a child script cannot export its environment back to the parent shell.
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
ssh-add -l
eval "$(ssh-agent -k)"Repeated debug2/debug3 messages come from SSH client logging, commonly -vvv or LogLevel DEBUG3. Run ssh -o LogLevel=INFO USERNAME@HOST from a fresh local shell to reduce it. Do not disable keepalives merely to hide logging.