telnet:提供telnet服务,使用未加密的用户/密码组进行验证,依附于xinetd服务。文件位于/etc/xinetd.d/telnet。
ekrb5-telnet:提供加密的telnet服务,但是必须要ekrb5的加密服务器。文件位于/etc/xinetd.d/ekrb5-telnet。
1、查看telnet rpm包
[root@rhel52 /]# rpm -qa | grep telnet |
[root@rhel52 work]# rpm -ivh telnet-server-0.17-38.el5.i386.rpm |
注:安装完毕以后会在/etc/xinetd.d/中出现一个telnet配置文件
1、查看telnet服务
[root@rhel52 /]# chkconfig --list | grep telnet |
[root@rhel52 /]# chkconfig telnet on |
[root@rhel52 /]# chkconfig --level 35 telnet on |
四、telnet服务调试
1、配置telnet文件
[root@rhel52 /]# vim /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 《=确认是no flags = REUSE socket_type = stream wait = no user = root server = /usr/sbin/in.telnetd log_on_failure += USERID } |
2、注意/etc/xinetd.d/ekrb5-telnet 和 krb5-telnet两个文件中的disable,稍后说明其作用。
五、telnet开启root
1、确认/etc/pam.d/login中的pam_securetty.so行,并将其注释掉"#"
[root@rhel52 /]# vim /etc/pam.d/login
#%PAM-1.0 #auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so auth include system-auth account required pam_nologin.so account include system-auth password include system-auth # pam_selinux.so close should be the first session rule session required pam_selinux.so close session include system-auth session required pam_loginuid.so session optional pam_console.so # pam_selinux.so open should only be followed by sessions to be executed in the user context session required pam_selinux.so open session optional pam_keyinit.so force revoke |
[root@rhel52 /]# vim /etc/securetty |
因为telnet服务是由xinetd调用,所以只要重新启动xinetd即可
[root@rhel52 /]# service xinetd restart |
Microsoft Windows [版本 6.1.7100]
C:\>telnet 192.168.238.220 正在连接192.168.238.220... Red Hat Enterprise Linux Server release 5 (Tikanga) Kernel 2.6.18-8.el5 on an i686 login: root Password: Last login: Sat Aug 1 22:47:15 from 192.168.238.1 [root@rhel52 ~]# |
八、telnet端口更改
设定配置文件/etc/services
[root@CentOS5 /]#vi /etc/services |
设定配置文件/etc/xinetd.d/telnet
[root@rhel52 /]# vim /etc/xinetd.d/telnet
access_time = 20:00-24:00
# 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 log_on_failure += USERID only_from = 192.168.0.0/16 }
#bind = 192.168.0.100 #only_from = 192.168.0.0/24 #no_access = 192.168.0.{80,90} #access_times = 8:00-9:00 20:00-23:00 |
十、配置文件krb5-telnet
文件所在位置 /etc/xinetd.d/krb5-telnet
其实rhel5已经装了krb5-telnet,那么就可以启用这个服务来达到开启telnet的目的。不用再安装telnet-server这个软件包了。可以使用Kerberos 5来进行认证。
[root@rhel52 /]# vim /etc/xinetd.d/krb5-telnet |
2、启动服务
[root@rhel52 /]# service xinetd restart |
文件所在位置 /etc/xinetd.d/ekrb5-telnet
ekrb5-telnet可以用来提供加密的telnet服务。如果启用了ekrb5-telnet服务,但是又没有Kerberos服务器的话,那么在进行telnet登录时,总是会报“Unencrypted connection refused. Goodbye.(未加密的连接,拒绝服务)”这个错误。
1、开启ekrb5-telnet服务。
[root@rhel52 /]# vim /etc/xinetd.d/ekrb5-telnet |
2、启动服务
[root@rhel52 /]# vim service xinetd restart |
十二、telnet登陆错误解析
①错误信息:
Cannot resolve network address for KDC in requested realm while getting initial credentials |
当出现如上信息时,请检查/etc/xinetd.d/krb5-telnet,并将“disable = no”改成yes
[root@rhel52 /]# vim /etc/xinetd.d/krb5-telnet |
Unencrypted connection refused. Goodbye. |
[root@rhel52 /]# vim /etc/xinetd.d/ekrb5-telnet
# default: off
# description: The kerberized telnet server accepts only telnet sessions, \ # which use Kerberos 5 authentication and encryption. service telnet { flags = REUSE socket_type = stream wait = no user = root server = /usr/kerberos/sbin/telnetd server_args = -e log_on_failure += USERID disable = no
} |
getnameinfo: localhost: Success |
[root@rhel52 /]# vim /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail. 127.0.0.1 localhost.localdomain localhost rhel52 #::1 rhel52 localhost6 192.168.238.220 rhel52 192.168.0.100 win-gk18e84nu08 |
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24435147/viewspace-687707/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/24435147/viewspace-687707/