2021-05-12 14:32:11
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
相關文章