Rsh Rexec Rlogin

注意:rsh, rexec, rloginは明文で情報(パスワードを含む)でネット上通信する。非常にリスク高くてお勧めできない!
sshで行うべきである。

CentOS, Redhat Enterpriseで検証済み

rsh-serverのインストール (インストールしてなければ)

[root@server01 ~]# rpm -ivh rsh-server-XXX.rpm

chkconfigでサービスをON

[root@server01 ~]# chkconfig rsh on
[root@server01 ~]# chkconfig rlogin on
[root@server01 ~]# chkconfig rexec on

/etc/securetty にrsh, rlogin, rexec追加
securettyは、rootがログインできる方法を記入します。デフォルトではrshは入ってないので、一般ユーザでログインできるようにしていても、securettyが設定されてないとrootではログインできません。

[root@server01 ~]# echo "rsh" » /etc/securetty
[root@server01 ~]# echo "rexec" » /etc/securetty
[root@server01 ~]# echo "rlogin" » /etc/securetty

/etc/pam.d/rsh, /etc/pam.d/rlogin, /etc/pam.d/rexec を変更

【編集前】
auth required /lib/security/pam_securetty.so

【編集後】
#auth required /lib/security/pam_securetty.so <==この行をコメントアウト

/etc/hosts.equiv, /etc/hosts.allow, /etc/hosts.deny の編集

[root@server01 ~]# cat /etc/hosts.equiv
localhost
server01
server02
server03
・・・・・・

[root@server01 ~]# cat /etc/hosts.deny
ALL: ALL

[root@server01 ~]# cat /etc/hosts.allow
ALL: 127.0.0.1 server01
in.telnetd: 192.168.1. # 192.168.1.0/24のネットワーク全部

[root@server01 ~]# chmod 600 /etc/hosts.allow /etc/hosts.equiv /etc/hosts.deny

/root/.rhostsの編集

一つ一つホスト名を書いてもいいけど、hosts.equivのコピーで済ます。
[root@server01 ~]# cp /etc/hosts.equiv /root/.rhosts

Reference:
http://kenknown.blog42.fc2.com/blog-entry-72.html