kristain

博客园 首页 新随笔 联系 订阅 管理

 在这个系统上默认只安装了telnet(也就是client)

 1.root@kristain-desktop:~# dpkg -s telnet 
 2.Package: telnet 
 3.Status: install ok installed 
 4.Priority: standard 
 5.Section: net 
 6.Installed-Size: 188 
 7.Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> 
 8.Architecture: i386 
 9.Source: netkit-telnet 
 10.Version: 0.17-36build1 
 11.Replaces: netstd 
 12.Provides: telnet-client
所以只能用telnet命令登录别人开启telnet服务的主机,其他人是不能使用telnet登录本机的。
1,现在要说的就是让别人能够使用telnet登录本机,需要安装两个软件:
1.root@kristain-desktop:~# apt-get install telnetd 
2.root@kristain-desktop:~# apt-get install xinetd 
其中telnetd是telnet-server,但它是无法自我启动的,需要管理daemon的软件xinetd来接管


1、安装xinetd 以及telnetd $ sudo apt-get install xinetd telnetd 2、配置文件 A。 /etc/inetd.conf $ cat /etc/inetd.conf (如果存在就不需要了) 显示telnet stream tcp nowait telnetd /usr/sbin/tcpd /usr/sbin/in.telnetd B. 修改/etc/xinetd.conf $ sudo gedit /etc/xinetd.conf # Simple configuration file for xinetd # # Some defaults, and include /etc/xinetd.d/ defaults { # Please note that you need a log_type line to be able to use log_on_success # and log_on_failure. The default is the following : # log_type = SYSLOG daemon info(插入红色部分) instances = 60 log_type = SYSLOG authpriv log_on_success = HOST PID log_on_failure = HOST cps = 25 30 } includedir /etc/xinetd.d C。修改/etc/xinetd.d/telnet $ sudo gedit /etc/xinetd.d/telnet 并加入以下内容: # default: on # description: The telnet server serves telnet sessions; it uses \ # unencrypted username/password pairs for authentication. service telnet { disable = no flags = REUSE socket_type = stream wait = no user = root server = /usr/sbin/in.telnetd #in.telnetd是telnetd安装文件 log_on_failure += USERID } 3. 重启机器或重启网络服务
$ sudo
/etc/init.d/xinetd restart
4. 使用TELNET客户端远程登录;ifconfig -a显示本机地址;
  可以确定telnet服务器已经搭建完成,这时只需要换个电脑,然后使用telnet ip即可登录。
  默认的设定是root不能通过telnet登录(telnet在网络上是明文传输,可以被sniffer侦测出密码),如果安全性有保证,可以通过一下方法允许root登录
  (1)修改/etc/securetty文件,添加终端
    root@kristain_desktop:~# tail -5 /etc/securetty 
    pts/0
    pts/1
    pts/2
    pts/3
    pts/4 或者直接将securetty文件改名,即可使用root登录
    (2)修改/etc/pam.d/login文件,将securetty验证注释调
        # Disallows root logins except on tty's listed in /etc/securetty 
    # (Replaces the `CONSOLE' setting from login.defs)
# Note that it is included as a "required" module. root will be
# prompted for a password on insecure ttys.
# If you change it to a "requisite" module, make sure this does not leak
# user name information.
#auth       required  pam_securetty.so
这样telnet基本上就配置完成了,不过还是建议大家用ssh
posted on 2012-07-13 14:53  kristain  阅读(1843)  评论(0编辑  收藏  举报