Enable Passwordless Authentication with ssh [duplicate]

折月煮酒 提交于 2020-01-06 19:59:41

问题


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?


回答1:


Add your public key to a file called authorized_keys.

Make sure that no group and other permissions are not set.




回答2:


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




回答3:


http://stromberg.dnsalias.org/~strombrg/ssh-keys.html

HTH




回答4:


  • Generate your keys using ssh-keygen
  • Copy over your SSH identity to the host (to which you need passwordless login) using ssh-copy-id.

man ssh-keygen and man ssh-copy-id on your system for help.



来源:https://stackoverflow.com/questions/11728697/enable-passwordless-authentication-with-ssh

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!