centos啟用root的telnet遠程登錄


默認情況下,telnet不允許root用戶登陸,需要做些配置。
首先關閉防火牆和selinux。
[root@centos6 ~]# iptables -F(臨時關閉防火牆)
[root@centos6 ~]#service iptables stop(永久關閉防火牆)
[root@centos6 ~]# iptables -L(查看防火牆狀態)
1、安裝telnet:
[root@centos6 ~]# yum install -y telnet-server telnet(服務器端及客戶端都安裝)
2、查看telnet端口狀態是否正確:
[root@centos6 ~]# vim /etc/services(查看telnet的端口號)
telnet 23/tcp
telnet 23/udp
3、設置telnet服務狀態為on:
兩種方法:
[root@centos6 ~]# chkconfig telnet on
或者:
[root@centos6 ~]# cat /etc/xinetd.d/telnet
# default: on
# description: The telnet server serves telnet sessions; it uses \
# unencrypted username/password pairs for authentication.
service telnet
{
disable = yes(改成no,允許登錄)
flags = REUSE
socket_type = stream
wait = no
user = root
server = /usr/sbin/in.telnetd
log_on_failure += USERID
}
4、配置權限(親自測試這步不需要):
[root@centos6 ~]# vim /etc/pam.d/login
auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so(注釋掉)
5、開通telent控制台:
在 /etc/securetty 文件最后,多添加一些pts終端入口,就可以以root用戶登陸了。
[root@centos6 ~]# vim /etc/securetty
console
vc/1
vc/2
vc/3
vc/4
vc/5
vc/6
vc/7
vc/8
vc/9
vc/10
vc/11
tty1
tty2
tty3
tty4
tty5
tty6
tty7
tty8
tty9
tty10
tty11
添加以下端口即可。
pts/0
pts/1
pts/2
pts/3
pts/4
pts/5
pts/6
pts/7
pts/8
pts/9
6.重啟服務
[root@centos6 ~]# service xinetd stop
[root@centos6 ~]# service xinetd start


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM