系统相关
首页 > 系统相关> > Linux 设置root用户无密码互访

Linux 设置root用户无密码互访

作者:互联网

在原有集群无密码访问的基础上,将新增节点机器的无密码访问加入集群中,具体步骤如下:

su - root

vim /etc/ssh/ssh_config

将StrictHostKeyChecking修改为no:

StrictHostKeyChecking no

执行ssh-keygen -t rsa命令,当出现”Enter Passphrase“的提示时直接按回车。

[root@rhino130 ~]# ssh-keygen -t rsa

[root@rhino130 ~]# ssh-copy-id rhino130
[root@rhino130 ~]# ssh-copy-id rhino131
[root@rhino130 ~]# ssh-copy-id rhino132
[root@rhino130 ~]# ssh-copy-id rhino133

下面这一步骤不一定要执行

[root@rhino131 ~]# scp ~/.ssh/authorized_keys root@rhino130:~/.ssh/

The authenticity of host 'rhino130 (10.45.150.130)' can’t be established.
ECDSA key fingerprint is SHA256:xk5ycxP8B+faMIDl43V9Ms9fkfrJvfq8KOwwPUzPnYU.
ECDSA key fingerprint is MD5:6b:4d:21:9d:3a:d2:0d:40:ce:fa:c2:f8:b6:a9:69:35. Are you sure you want to continue connecting (yes/no)?yes
Warning: Permanently added 'rhino130,10.45.150.130' (ECDSA) to the list of known hosts.
root@rhino130’s password:
#输入root密码

无需输入密码可正常跳转。

[root@rhino130 ~]# ssh rhino131

标签:rhino130,互访,密码,ssh,Linux,copy,root,id
来源: https://www.cnblogs.com/viki1996/p/16699548.html