Mikey’s Linux Field NotesAll topics

GUIDE 05 / ADMINISTRATION

SSH, keys & agents

Connect securely, copy files, and manage authentication keys.

2 quick lessons · Examples to adapt to your server
In this guide
Create and install a public keyUse an SSH agent

Commands use class paths and example filenames. Replace placeholders and inspect the target before making changes.

01

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.

COMMANDS & EXAMPLES
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:~/
Field note

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.

02

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.

COMMANDS & EXAMPLES
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
ssh-add -l
eval "$(ssh-agent -k)"
Field note

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.