以下為設置步驟
1钉迷,生成密鑰的公鑰和私鑰
[root@puppet_client .ssh]# 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:
36:51:f0:41:60:5f:45:0b:a5:95:9b:78:c6:09:e4:b6 root@puppet_client.luckcart.com
2,通過其他工具把上述生成的私鑰下載到本地的windows機器上羞芍,并且把公鑰導入到.ssh/authorized_keys 文件中去
cat id_rsa.pub > authorized_keys
3,設置sshd 服務器服務打開以下設置:
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
修改以下設置:
ChallengeResponseAuthentication no
PasswordAuthentication no
UsePAM no
service sshd restart
4,導入私鑰到遠程工具中郊艘,實驗采用xshell荷科。
3,此時輸入剛才設置的密碼短語唯咬,如果在生成密鑰的時候沒有輸入密碼短語,此時可以不用輸入畏浆。
5.經(jīng)過以上步驟胆胰,即可完成私鑰登錄了。