centos ssh免密码登录别一台linux主机

两台linux主机,主机A要免密码登录到主机B

1.首先生成A,B各自的密钥文件

在各自的主机上执行以下命令

[root@SH-DEV ~]# 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.

其中几处直接回车跳过

2.在主机B上编辑/root/.ssh/authorized_keys文件,将主机A的/root/.ssh/id_rsa.pub的密钥粘贴进去即可

阅读更多
个人分类: linux
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

不良信息举报

centos ssh免密码登录别一台linux主机

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭