Ubuntu Linux telnet的安装设置

网络 网络管理
文章摘要:下面我们来对Ubuntu Linux telnet的安装和设置进行一下讲解。首先我们需要加载Telnet的服务,之后对于root等有关方面进行设置。

在Windows系统中,telnet的配置相对简单一些。那么在Ubuntu Linux中的telnet的设置就相对比较麻烦了。不少朋友都对这个安装过程不熟悉。没有关系,这里我们就来对Ubuntu Linux telnet的安装设置进行一下讲解。

1. sudo apt-get install xinetd telnetd

2. Ubuntu Linux telnet安装后,系统也会有相应提示:

sudo vi /etc/inetd.conf并加入以下一行

  1. telnet stream tcp nowait telnetd /usr/sbin/tcpd /usr/sbin/in.telnetd 

3. sudo vi /etc/xinetd.conf并加入以下内容进行下一步的Ubuntu Linux telnet设置:

  1. # Simple configuration file for xinetd  
  2. #  
  3. # Some defaults, and include /etc/xinetd.d/  
  4. defaults  
  5. {  
  6. # Please note that you need a log_type line to be able to use log_on_success  
  7. # and log_on_failure. The default is the following :  
  8. log_type = SYSLOG daemon info  
  9. instances = 60 
  10. log_type = SYSLOG authpriv  
  11. log_on_success = HOST PID  
  12. log_on_failure = HOST 
  13. cps = 25 30  
  14. }  
  15. includedir /etc/xinetd.d 

4. sudo vi /etc/xinetd.d/telnet并加入以下内容:

  1. # default: on  
  2. # description: The telnet server serves telnet sessions; it uses \  
  3. # unencrypted username/password pairs for authentication.  
  4. service telnet  
  5. {  
  6. disable = no 
  7. flags = REUSE 
  8. socket_type = stream 
  9. wait = no 
  10. user = root 
  11. server = /usr/sbin/in.telnetd  
  12. log_on_failure += USERID  

5. 重启机器或重启网络服务sudo /etc/init.d/xinetd restart

6. 使用TELNET客户端远程登录即可进行非root用户访问.

7.使用root登录:

mv /etc/securetty /etc/securetty.bak 这样root可以登录了.也可这样:

修改/etc/pam.d/login这个文件.只需将下面一行注释掉即可.

  1. #auth required lib/security/pam_securetty.so 

8. Ubuntu Linux telnet的详细配制/etc/xinetd.d/telnet#p#

  1. service telnet  
  2. {  
  3. disable =no 
  4. bind =192.168.1.2  
  5. only_from=192.168.1.0/24  
  6. #上面这两行说明仅提供内部网段!  
  7. Instance =UNLIMITED 
  8. Nice =0 
  9. Flags =REUSE 
  10. socket_type=stream 
  11. wait =no 
  12. user =root 
  13. #server =/usr/sbin/telnetd  
  14. server =/usr/sbin/in.telnetd  
  15. server_args =-a none  
  16. log_on_failure +=USERID  
  17. }  
  18. service telnet  
  19. {  
  20. disable =no 
  21. bind =140.116.142.196  
  22. only_from=140.116.0.0/16  
  23. no_access=140.116.32.{10,26}  
  24. #上面三行设置外部较为严格的限制  
  25. instance =10 
  26. umask =022 
  27. nice =10 
  28. flags =REUSE 
  29. socket_type=stream 
  30. wait =no 
  31. user =root 
  32. #server =/usr/sbin/telnetd  
  33. server =/usr/sbin/in.telnetd  
  34. log_on_failure +=USERID  

9.加设防火墙iptables:

如果想要针对192.168.0.0/24这个网段及61.xxx.xxx.xxx这个IP进行telnet开放,可以增加下面几行规则:

  1. /sbin/iptables -A INPUT -p tcp -i eth0 -s 192.168.0.0/24 --dport 23 -j ACCEPT  
  2. /sbin/iptables -A INPUT -p tcp -i eth0 -s 61.xxx.xxx.xxx --dport 23 -j ACCEPT  
  3. /sbin/iptables -A INPUT -p tcp -i eth0 --dport 23 -j DROP 

10.Ubuntu Linux telnet最后一项设置,加设防火墙/etc/hosts.allow(deny)机制:

上面开放了192.168.0.0/24这个网段,但是如果您只想让其中的192.168.0.1~192.168.0.5进入,可以设置如下 :

  1. vi /etc/hosts.allow  
  2. in.telnetd:192.168.0.1,192.168.0.2,192.168.0.3,192.168.0.4,192.168.0.5:allow 

 

责任编辑:佟健 来源: 网络转载
相关推荐

2011-02-24 12:57:42

Ubuntuvsftpd安装

2010-03-05 16:20:38

Ubuntu中文环境

2010-02-22 15:04:53

Ubuntu 7.04

2010-07-26 13:44:33

Ubuntu teln

2010-03-05 10:57:46

Ubuntu vsft

2011-03-09 14:02:55

LAMP安装设置

2011-02-23 10:11:10

ProFTPd安装

2011-03-02 15:12:11

2010-01-13 15:53:11

CentOS vsft

2010-01-11 15:25:30

Fedora VMwa

2010-07-16 14:31:11

Linux Telne

2010-07-19 11:50:44

Linux Telne

2010-01-15 13:55:17

CentOS mail

2010-12-15 12:48:26

VirtualBox

2010-07-16 14:02:07

Linux telne

2009-11-18 09:53:50

PHP安装设置

2009-08-07 11:46:57

JAVA虚拟机安装设置

2009-12-01 17:15:33

ADSL路由器安装

2011-01-10 09:47:01

StunnelStunnel设置Stunnel使用

2009-08-08 15:25:05

无线路由器硬件安装路由器设置
点赞
收藏

51CTO技术栈公众号