如何在centos下开启telnet服务?
1.查看linux版本信息:
[loong@localhost ~]$ cat /etc/issue CentOS release 5.8 (Final)Kernel \r on an \m
2. 查看系统是否已安装telnet-server,linux系统上默认已经安装telnet-client(或telnet),而telnet-server需要手动安装。
[loong@localhost ~]$ rpm -qa | grep telnet telnet-0.17-39.el5
3. 安装telnet-server,若系统已安装,跳过此步。
方法一:下载RPM resource telnet-server
选择相应版本的telnet-server下载;
安装:# rpm -i telnet-server-0.17-39.el5.i386.rpm
#貌似还得单独安装xinetd.
方法二:(推荐使用)
# yum install telnet-server
安装完成后:
[loong@localhost ~]$ rpm -qa | grep telnet telnet-0.17-39.el5 telnet-server-0.17-39.el5
4. 启动telnet服务
方法一:System->Administration->Services 中,
在On Demand Services
中选中telnet
,
并在Background Services中选中xinetd,并点击上面的Start,即在右侧显示:xinetd (pid 15986) is running...
最后Save & Quit.
方法二:编辑/etc/xinetd.d/telnet
, 将其中的 disable = yes
的yes
改为no
.
修改后:
# 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
}
方法三:使用chkconfig命令直接开启
[root@localhost loong]# chkconfig telnet on
注:方法二和方法三,需要激活xinetd服务。方法如下:
[root@localhost loong]# service xinetd restart Stopping xinetd: [ OK ] Starting xinetd: [ OK ]
或:
[root@localhost loong]# /etc/rc.d/init.d/xinetd restart Stopping xinetd: [ OK ] Starting xinetd: [ OK ]
5. 测试服务
[root@localhost loong]# telnet localhost Trying 127.0.0.1...Connected to localhost.localdomain (127.0.0.1).Escape character is '^]'.CentOS release 5.8 (Final)Kernel 2.6.18-308.1.1.el5 on an i686 login: loong Password: Last login: Tue Apr 24 16:42:06 from 10.108.14.135[loong@localhost ~]$ exitlogout Connection closed by foreign host.[root@localhost loong]#
注:默认情况下,系统只允许普通用户telnet登录,不允许root用户登录。
要想获得root权限,可以使用普通用户登录,然后执行su,来获得root权限。
或使用一下方法,允许root登录telnet:
方法一:# mv /etc/securetty /etc/securetty.bak (不建议这种方法,测试完后再改回去吧!)
或先试图使用root用户登录,不成功,然后查看系统log:
telnet> o localhost Trying 127.0.0.1...Connected to localhost.localdomain (127.0.0.1).Escape character is '^]'.CentOS release 5.8 (Final)Kernel 2.6.18-308.1.1.el5 on an i686 login: root Password: Login incorrect login: Login incorrect login: Login incorrect login: Connection closed by foreign host.[root@localhost loong]# tail -20 /var/log/secure Apr 24 17:32:58 localhost login: pam_securetty(remote:auth): access denied: tty 'pts/1' is not secure ! Apr 24 17:33:03 localhost login: FAILED LOGIN 1 FROM localhost FOR root, Authentication failure
可以看到 access denied: tty 'pts/1' is not secure ! 所以将‘pts/1’添加到/etc/securetty中,即可实现telnet的root用户登录。至于为什么?暂不清楚。 方法二:修改/etc/pam.d/remote,注释掉:auth required pam_securetty.so 1 #%PAM-1.02 #auth required pam_securetty.so3 auth include system-auth
注:不建议开放telnet的root登录,容易带来安全隐患。
相关参考:centOS教程
以上是如何在centos下开启telnet服务的详细内容。更多信息请关注PHP中文网其他相关文章!

CentOS的替代方案包括AlmaLinux、RockyLinux和OracleLinux。1.AlmaLinux提供RHEL兼容性和社区驱动开发。2.RockyLinux强调企业级支持和长期维护。3.OracleLinux提供Oracle特有的优化和支持。这些替代方案都具备与CentOS相似的稳定性和兼容性,适合不同需求的用户。

CentOS因其稳定性和长生命周期而适合企业和服务器环境。1.CentOS提供长达10年的支持,适用于需要稳定运行的场景。2.Ubuntu适合需要快速更新和用户友好的环境。3.Debian适用于需要纯净和自由软件的开发者。4.Fedora适合喜欢尝试最新技术的用户。

CentOS的替代方案包括AlmaLinux、RockyLinux和OracleLinux。1.AlmaLinux和RockyLinux通过1:1重建RHEL,提供高稳定性和兼容性,适合企业环境。2.OracleLinux通过UEK提供高性能,适合熟悉Oracle技术栈的用户。3.选择时需考虑稳定性、社区支持和软件包管理。

CentOS替代方案包括RockyLinux、AlmaLinux和OracleLinux。1.RockyLinux和AlmaLinux提供与RHEL兼容的稳定发行版,适合需要长期支持的用户。2.CentOSStream适合关注新功能和开发周期的用户。3.OracleLinux适用于需要企业级支持的用户。

CentOS需要替代品是因为CentOSStream不再提供长期支持。替代选项包括:1.RockyLinux,提供10年生命周期支持,适合需要稳定性的用户。2.AlmaLinux,同样提供10年支持,有强大社区支持。3.OracleLinux,提供与RHEL兼容的版本,生命周期管理灵活。

CentOS的终结对用户产生了重大影响,用户可选择RHEL、AlmaLinux、Debian或Ubuntu作为替代方案。1.迁移成本高,需时间和金钱。2.社区分裂影响开源项目。3.RHEL提供商业支持,但成本高。4.AlmaLinux与CentOS相似,迁移成本低。5.Debian和Ubuntu需更多时间适应。

CentOS适合作为企业级服务器操作系统,因为它稳定、安全且免费。1)它基于RHEL,提供与RHEL高度的兼容性。2)使用yum进行包管理,确保软件安装和更新简便。3)社区定期发布安全补丁,支持周期长达10年。

CentOS停止维护的原因是RedHat的战略转变,用户应对策略包括:1.迁移到其他发行版,如UbuntuServer、Debian或RockyLinux;2.继续使用CentOS7至2024年6月;3.转向CentOSStream;4.自建解决方案,如基于RHEL的定制发行版或使用容器技术。


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

Video Face Swap
使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热门文章

热工具

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)

Dreamweaver CS6
视觉化网页开发工具

记事本++7.3.1
好用且免费的代码编辑器

Atom编辑器mac版下载
最流行的的开源编辑器

VSCode Windows 64位 下载
微软推出的免费、功能强大的一款IDE编辑器