On your desktop or the computer you want to SSH from run this command:
Code:# ssh-keygen -t dsaYou will see results similar to this:
- You will be asked to enter a location, use the default.
- Enter a prassphrase (it is not recommended to leave this blank)
Now you need to put your public key on the remote server in a file at ~/.ssh/authorized_keys2. You can do this one of two ways.Your identification has been saved in /home/username/.ssh/id_dsa.
Your public key has been saved in /home/username/.ssh/id_dsa.pub.
The key fingerprint is:
6b:62:7c:60:81:04:97:3e:62:c8:1c:9e:96:49:11:b4 name@host
1) Execute this command:
2) Copy/Paste the file.Code:# cat ~/.ssh/id_dsa.pub | ssh username@hostname 'cat - >> ~/.ssh/authorized_keys2'
- Open ~/.ssh/id_dsa.pub using vi/vim/nana/pico/etc (your favorite editor).
- Select all of the contents and copy the data into your clipboard.
- SSH into the remote server
- vi/vim/nano/pico/etc (your favorite editor) ~/.ssh/authorized_keys2
- Paste the contents of your clipboard (should be the public key copied from above).
- Save the file
That is it! Logout of the remote system and then SSH back into the remote system. If everything worked fine you should be asked for a passphrase.
Thanks Tor, this will be helpful. I'm constantly looking this information up as well.
Tor, I am looking into doing this, do you mind explaining how to reverse the process? Say you wanted to remove a key. Do you delete the key files, or clear them out?
Checkout my new forum! http://adminreference.com/
If you want to remove a single key just remove it from this file:~/.ssh/authorized_keys2
It is easy to see how they are segmented and delete only one. Alternatively you can delete the whole file to remove all keys.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks