LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to create "SSH Key" (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-create-ssh-key-862491/)

JeffC1 02-13-2011 07:32 PM

How to create "SSH Key"
 
I've read tutorials on doing this and found it too difficult.

Id like to create a SSH Key on a Redhat box. Can you provide step by step example how to? What if authorized keys exist already on the server? Please advise! Thankyou

alienDog 02-13-2011 07:45 PM

Well, say you want to use key-based authentication to log in from machine A to machine B, you need to:

1) Run ssh-keygen on machine A, this will create id_dsa.pub or id_rsa.pub file under /home/[yourusername]/.ssh on machine A.

ssh-keygen will ask you to set a passphrase for the key, if you don't want one (which is likely the case), just hit enter.

2) Open authorized keys file on machine B (under /home/[yourusername]/.ssh directory) to your favourite text editor. If the file isn't there yet, just create it.

3) Display the contents of id_?sa.pub file by doing: "cat $HOME/.ssh/id_?sa.pub" on the terminal on machine A. Without the quotes, of course.

4) Copy-paste the contents of id_?sa.pub to the end of authorized_keys file on the text editor. Save and exit.

There are plenty of other ways of doing this, but I think this is the easiest.

JeffC1 02-13-2011 08:44 PM

Thank you! I'm still reading up on this. What is Machine A is a Windows machine using Putty?

grail 02-13-2011 09:11 PM

Try - 'putty create ssh key' in google ... has quite a few good hits

rich_c 02-13-2011 09:16 PM

There's a good guide on the PuTTY site.


All times are GMT -5. The time now is 08:02 AM.