RSA Key – Tech Stuff https://gofedora.com How Tos, Tutorials, Tips and Tricks Thu, 18 Jun 2015 14:17:41 +0000 en-US hourly 1 https://wordpress.org/?v=4.9.4 How To: RSA Key Generation for Remote Host https://gofedora.com/how-to-rsa-key-generation-remote-host/ https://gofedora.com/how-to-rsa-key-generation-remote-host/#comments Thu, 08 Dec 2005 16:03:26 +0000 http://172.17.8.64/gofedora/?p=262 … ]]> Using RSA key of a remote machine you can authenticate for SSH for that machine without entering a password. Generating RSA key is very easy and simple. Follow the procedure below to generate keys for two machine. Machies: 1) mirage (192.168.36.205) and students (192.168.36.200).

Step 1
use this command on mirage server

[kulbir@mirage ~] ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
32:30:af:c6:0b:e2:c0:60:92:fd:62:da:37:32:f2:ce root@LocalHost

You should get the result as above and if it asks to overwrite something then overwrite it.

Step 2

[kulbir@mirage ~] scp ~/.ssh/id_rsa.pub user@192.168.36.200:~/.ssh/authorized_keys2
user@192.168.36.200''s password:

Now if the above operation was successful, then you can login from your mirage account to your students account without a password. Try it, and if it is successful then do the same for your students server. Now you don’t need type your password again and again to login from one server to the other.

If the above worked for you, then there is one more thing you can try out. Go to .ssh/ directory in your home directory and create a file named ‘config’. Now write in that file

host students
hostname 192.168.36.200
port 22
user kulbirsaini

and save the file. You have to specify the port on which SSH is listening. Save this file and now you can login by just typing

[kulbir@mirage ~] ssh students [Enter]

You can write whatever you want in place of ‘students’ in the file and then login typing ssh ‘word’ that you have written against the host in file.

]]>
https://gofedora.com/how-to-rsa-key-generation-remote-host/feed/ 2