- 论坛徽章:
- 0
|
1. 为系统安装配置rlogin(未果)
1) apt-get install rsh-server (从网上查到的, rsh-server中含有rlogin模块, 之前一直以为是 直接安装rlogin)
2)安装成功找不到启动rlogin服务的方法, 百度, 谷歌了一番,发现大家基本都用xinetd启动
3)系统没有发现xinetd服务,转入第二步,安装xinetd。
2. 安装xinetd
1)apt-cache search xinetd
采用上述命令未找到 xinetd相关的包, 直接到
http://www.xinetd.org/
上 下载源码,
解压后进入源码目录执行 ./confiugre, make , make install(这些步骤可以在源码根目录下的INSTALL文件中找到。)
3. 配置xinetd
根据网上搜到资料显示,rlogin和rsh 安装的默认配置是有xinetd服务管理的,故应该在/etc/xinetd.d (安装完没有此目录重新启动xinetd服务就可以了)目录下下面的rsh 和rlogin文件中将disable = yes 改为 disable = no , 但我是先安装rlogin再安装xinetd服务的, 所以/etc/xinetd.d目录下不存在这两个文件。所以我的做法如下:
1)在/etc/xinetd.d目录下创建 rsh文件,并加入以下内容
# default: on
# descrīption: 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
}
注意红色部分
2) 在/etc/xinetd.d 目录下创建 rlogin 文件, 并加入以下内容
# default: on
# descrīption: 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
}
注意红色部分
3)重新启动xinetd
按照网上的说法 只要执行sudo /etc/init.d/xinetd restart就可以了, 不过在我这里行不通, 现在还没找原因(挖坑, 找到再补上) 我采用另外一种方法启动, 先kill掉xinetd进程, 然后再到/usr/sbin下执行./xinetd.
4)到现在为止 基本已经完成了, 不过我还是走了一些弯路, 当查看进程时发现没有rlogin服务, 所以有折腾了一番, 后来看到别人说用 rlogin 127.0.0.1 测试本地登陆, 才恍然大悟, 试过才知道, 其实rlogin服务是可以用的, 因为513端口处于监听状态。大概是xinetd在管理吧, 具体实现(挖坑)
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/89290/showart_1984089.html |
|