mmn357157
Hi! mmn, you need to run the ssh-keygen command. This will create the public and private keys. For example ssh-keygen -t rsa will generate a pair of rsa keys. You then need to copy the rsa.pub or public key to the host you want to have password-less logins to. On the that host you would issue a cat rsa.pub into a file called authorized_keys, and chmod it to 600. This will allow you to login to your second pc without passwords. Once you issue the ssh-keygen command it will create a .ssh subdirectory in the directory you currently are in. For your example you are in /home/mmn and run ssh-keygen -t rsa it would create a .ssh subdirectory in /home/mmn/.ssh.
[root@pc1 ~]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Created directory '/root/.ssh'.
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:
24:d6:ae:a1:cf:f4:bf:b1:09:c0:f9:3b:ee:4f:f0:4c
root@localhost.localdomain
[root@pc1 ~]# cd .ssh
[root@pc1 .ssh]# ls -la
total 20
drwx------ 2 root root 4096 May 20 03:05 .
drwxr-x--- 4 root root 4096 May 20 03:05 ..
-rw------- 1 root root 883 May 20 03:05 id_rsa
-rw-r--r-- 1 root root 236 May 20 03:05 id_rsa.pub --> copy this file to your second PC
On PC2
root@pc2 .ssh]# cat id_rsa.pub > authorized_keys