Linux ·

RHEL7.2 SSH非root用户无密码登录

RHEL7.2 SSH非root用户无密码登录

1 修改三台虚拟机的/ect/hosts文件

[Hadoop@hadoop01 ~]$ cat /etc/hosts
127.0.0.1  localhost localhost.localdomain localhost4 localhost4.localdomain4
::1        localhost localhost.localdomain localhost6 localhost6.localdomain6
[hadoop@hadoop01 ~]$ su - root
密码:
上一次登录:六 11月  4 15:52:36 CST 2017pts/0 上
ABRT has detected 1 problem(s). For more info run: abrt-cli list --since 1509781956
[root@hadoop01 ~]# vi /etc/hosts
[root@hadoop01 ~]# cat /etc/hosts
127.0.0.1  localhost localhost.localdomain localhost4 localhost4.localdomain4
::1        localhost localhost.localdomain localhost6 localhost6.localdomain6
 
192.168.169.101 hadoop01
192.168.169.102 hadoop02
192.168.169.103 hadoop03

2 修改三台虚拟机的/etc/ssh/sshd_config

[root@hadoop01 ~]# vi /etc/ssh/sshd_config
[root@hadoop01 ~]# cat /etc/ssh/sshd_config | grep uth | grep -v "#"
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile  .ssh/authorized_keys

参与评论