Log into a remote machine without typing in a password.
- Generate New SSH Key (if needed)
ssh-keygen -t ed25519 -C "email@example.com"
- Start SSH Agent & Add Key
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
- Copy Public Key to Remote Machine
ssh-copy-id -i ~/.ssh/id_ed25519.pub me@server-ip-address
- Streamline with a Config File
- Update (or Create):
~/.ssh/config
- Update (or Create):
Host remote-machine
HostName server-ip-address
User me
IdentityFile ~/.ssh/id_ed25519
- Test Connection (from Host)
ssh remote-machine