How to Set Up and Manage SSH Keys on Linux

Rob

Administrator
Staff member
Joined
Oct 27, 2011
Messages
1,865
Reaction score
3,569
Credits
9,033
Today we're going to go over the use of SSH keys. How to use them, setting them up and why they're preferred! We'll go through creating different keys for different uses, adding public keys to a remote server, setting up an SSH config file for management and more!

Helpful reference:
Code:
GENERATE KEY:
ssh-keygen -t ed25519 -C "comment" -f /path/to/key

COPY TO SERVER:
ssh-copy-id user@server

CONFIG FILE (~/.ssh/config):
Host nickname
    HostName server.com
    User username
    IdentityFile ~/.ssh/id_keyname

CORRECT PERMISSIONS:
~/.ssh/                 700
~/.ssh/id_ed25519       600
~/.ssh/id_ed25519.pub   644
~/.ssh/authorized_keys  600
~/.ssh/config           600

 

Attachments

  • ssh_keys-video2-YT.png
    ssh_keys-video2-YT.png
    616.6 KB · Views: 316,476


Nice, now I can login to my rpi3 without typing that darned password lol, thx
 


Follow Linux.org

Staff online

Members online


Top