四、分别在两台机器/etc/xinetd.d目录内创建rlogin和rsh文件,写入文件内容并确保存在disable = no rlogin:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
[root@localhost ~]# cat /etc/xinetd.d/rlogin # default:on # description: rlogind is the server for the rlogin(1) program. The server # provides a remote login facility with authentication based on # privileged port numbers from trusted hosts. service login { disable = no socket_type = stream wait = no user = root log_on_success += USERID log_on_failure += USERID server = /usr/sbin/in.rlogind }
rsh:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
[root@localhost ~]# cat /etc/xinetd.d/rsh # default:on # description: The rshd server is the server for the rcmd(3) routine and, # consequently, for the rsh(1) program. The server provides # remote execution facilities with authentication based on # privileged port numbers from trusted hosts. service shell { disable = no socket_type = stream wait = no user = root log_on_success += USERID log_on_failure += USERID server = /usr/sbin/in.rshd }
[root@localhost ~]# systemctl status firewalld ● firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled) Active: active (running) since 三 2018-11-07 16:15:41 CST; 1h 42min ago Docs: man:firewalld(1) Main PID: 1121 (firewalld) Tasks: 2 CGroup: /system.slice/firewalld.service └─1121 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid
11月 07 16:15:37 localhost.localdomain systemd[1]: Starting firewalld - dynamic fi.... 11月 07 16:15:41 localhost.localdomain systemd[1]: Started firewalld - dynamic fir.... Hint: Some lines were ellipsized, use -l to show in full.
如果是,请务必将两台机器的防火墙关闭。
八、测试rlogin和rsh功能
1 2 3 4 5 6 7 8 9 10 11
[root@localhost ~]# rlogin rcptwo Last login: Wed Nov 7 18:04:09 from rcpone [root@localhost ~]# exit 登出 rlogin: connection closed.
[root@localhost ~]# rsh rcptwo Last login: Wed Nov 7 17:50:50 from rcpone [root@localhost ~]# exit 登出 rlogin: connection closed.