This question already has an answer here:
- Bash: controlling SSH 7 answers
How can I enable password less authentication with SSH.
This is what I have when I was looking for /.ssh folder.
bash-3.00$ cd ~/.ssh
bash-3.00$ pwd
/home/uname/.ssh
bash-3.00$ ls -lt
total 2
-rw-r--r-- 1 uname gid-uname 489 Jul 26 18:55 known_hosts
And I don't know what next I have to do here? I need to change the permission of known_hosts
folder? Or something else?
ssh-keygen
ssh-copy-id
.man ssh-keygen
andman ssh-copy-id
on your system for help.To enable passwordless ssh between remote and local machine, you have to perform these steps on your local machine :-
1st Step> root@localmachine:~> ssh-keygen -t rsa
Note - Considering that .ssh dir is already present in remote machine if not, then do this (ssh root@remotemachine mkdir -p .ssh)
2nd Step> cat .ssh/id_rsa.pub | ssh root@remotemachine 'cat >> .ssh/authorized_keys'
3rd Step> root@localmachine:~> ssh root@remotemachine
Add your public key to a file called
authorized_keys
.Make sure that no
group
andother
permissions are not set.http://stromberg.dnsalias.org/~strombrg/ssh-keys.html
HTH