Centos rsh免密登录

安装相关服务

yum -y install rsh*
yum -y install xinetd

添加配置文件
1.在目录/etc/xinetd.d/下分别添加rsh,rlogin,rexec文件,其中文件内容为(**重点在于保证disable = no **):

#rsh
service shell { 
    disable = no 
    socket_type = stream 
    wait = no 
    user = root 
    log_on_success += USERID 
    log_on_failure += USERID 
    server = /usr/sbin/in.rshd 
}

#rlogin

service login { 
    disable = no 
    socket_type = stream 
    wait = no 
    user = root 
    log_on_success += USERID 
    log_on_failure += USERID 
    server = /usr/sbin/in.rlogind 
}

#rexec

service exec { 
    disable = no 
    socket_type = stream 
    wait = no 
    user = root 
    log_on_success += USERID 
    log_on_failure += USERID 
    server = /usr/sbin/in.rexecd 
}

2.然后在目录/etc/securetty最后几行添加rexec,rsh,rlogin
Centos rsh免密登录_第1张图片

3.在目录/etc/hosts.equiv下添加其余虚拟机信息
在这里插入图片描述
4.添加目标用户的home目录创建.rhosts文件,内容和hosts.equiv相同
在这里插入图片描述
启动服务

systemctl restart rsh.socket
systemctl restart rlogin.socket
systemctl restart rexec.socket
systemctl enable rsh.socket
systemctl enable rlogin.socket
systemctl enable rexec.socket

systemctl restart xinetd

然后通过rsh命令就可以实现接入其他的虚拟机了

rsh eda
#此处eda为其他服务器的hostname

你可能感兴趣的:(centos,linux,运维)