[ 2 root ] $ cat /etc/securetty
#
# This file contains the device names of tty lines (one per line,
# without leading /dev/) on which root is allowed to login.
#
tty1
tty2
tty3
tty4
tty5
tty6
rsh
rlogin
rexec
[ 3 root ] $ cat /etc/xinetd.d/rsh
# default: off
# description:
# The rshd server is a 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
{
socket_type = stream
protocol = tcp
flags = NAMEINARGS
wait = no
user = root
group = root
log_on_success += USERID
log_on_failure += USERID
server = /usr/sbin/tcpd
# server_args = /usr/sbin/in.rshd -L
server_args = /usr/sbin/in.rshd -aL
disable = no
}
[ 4 root ] $ cat /etc/xinetd.d/rlogin
# default: off
# description:
# Rlogind is a server for the rlogin program. The server provides remote
# execution with authentication based on privileged port numbers from trusted
# host
#
service login
{
socket_type = stream
protocol = tcp
flags = NAMEINARGS
wait = no
user = root
group = root
log_on_success += USERID
log_on_failure += USERID
server = /usr/sbin/tcpd
server_args = /usr/sbin/in.rlogind
# server_args = /usr/sbin/in.rlogind -a
disable = no
}
问题在这里:
XXXXXXX2003:db2pb1 51> rsh XXXXXX2001
Local Password: /*Eventhough it's empty password phrase, but it shouldn't prompt*/
Last login: Tue Mar 2 16:23:06 from
Directory: /db2/db2pb1
Tue Mar 2 16:23:06 UTC 2021
尽管一开始它不起作用,但我复制了以下三个文件以成功实现 rsh 登录。
db2pb1 51> ll /usr/sbin/in.rexecd
-rwxr-xr-x 1 root root 15136 Mar 2 11:30 /usr/sbin/in.rexecd
-rwxr-xr-x 1 root root 23512 Mar 2 11:30 /usr/sbin/in.rlogind
-rwxr-xr-x 1 root root 23840 Mar 2 11:30 /usr/sbin/in.rshd
答案1
我从另一个正常运行的系统复制了 rsh 和 rlogin 的 pam.d 文件后解决了这个问题。问题已修复。