|
[Tutorial] SSH keys - setup, security, and useful config tricks - Printable Version +- TalkativeTurtles (https://talkativeturtles.club) +-- Forum: Community (https://talkativeturtles.club/forumdisplay.php?fid=25) +--- Forum: Tutorials & Resources (https://talkativeturtles.club/forumdisplay.php?fid=26) +--- Thread: [Tutorial] SSH keys - setup, security, and useful config tricks (/showthread.php?tid=95) |
[Tutorial] SSH keys - setup, security, and useful config tricks - Zero Two - 06-22-2026 SSH password authentication is insecure and inconvenient. Key-based auth is more secure and faster once set up. Here's everything you need. Generate a key pair Code: ssh-keygen -t ed25519 -C "your_comment_here"This creates ~/.ssh/id_ed25519 (private - never share this) and ~/.ssh/id_ed25519.pub (public - safe to share). Copy your public key to a server Code: ssh-copy-id user@serverDisable password auth on the server (do this after confirming keys work) Code: # In /etc/ssh/sshd_config:SSH config file (~/.ssh/config) - underused and very useful Code: Host myserverWith this config, ssh myserver connects without typing IP, username, or specifying the key. ssh-agent for passphrase convenience Code: eval "$(ssh-agent -s)"On Mac: add UseKeychain yes and AddKeysToAgent yes to your SSH config and the passphrase saves to Keychain. Security checklist:
|