如何在centos下开启telnet服务
如何在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中文网其他相关文章!

热AI工具

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

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

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

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

SublimeText3汉化版
中文版,非常好用

禅工作室 13.0.1
功能强大的PHP集成开发环境

Dreamweaver CS6
视觉化网页开发工具

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

热门话题

提升CentOS上HDFS性能:全方位优化指南优化CentOS上的HDFS(Hadoop分布式文件系统)需要综合考虑硬件、系统配置和网络设置等多个方面。本文提供一系列优化策略,助您提升HDFS性能。一、硬件升级与选型资源扩容:尽可能增加服务器的CPU、内存和存储容量。高性能硬件:采用高性能网卡和交换机,提升网络吞吐量。二、系统配置精调内核参数调整:修改/etc/sysctl.conf文件,优化TCP连接数、文件句柄数和内存管理等内核参数。例如,调整TCP连接状态和缓冲区大小

CentOS将于2024年停止维护,原因是其上游发行版RHEL 8已停止维护。该停更将影响CentOS 8系统,使其无法继续接收更新。用户应规划迁移,建议选项包括CentOS Stream、AlmaLinux和Rocky Linux,以保持系统安全和稳定。

CentOS 关机命令为 shutdown,语法为 shutdown [选项] 时间 [信息]。选项包括:-h 立即停止系统;-P 关机后关电源;-r 重新启动;-t 等待时间。时间可指定为立即 (now)、分钟数 ( minutes) 或特定时间 (hh:mm)。可添加信息在系统消息中显示。

CentOS 和 Ubuntu 的关键差异在于:起源(CentOS 源自 Red Hat,面向企业;Ubuntu 源自 Debian,面向个人)、包管理(CentOS 使用 yum,注重稳定;Ubuntu 使用 apt,更新频率高)、支持周期(CentOS 提供 10 年支持,Ubuntu 提供 5 年 LTS 支持)、社区支持(CentOS 侧重稳定,Ubuntu 提供广泛教程和文档)、用途(CentOS 偏向服务器,Ubuntu 适用于服务器和桌面),其他差异包括安装精简度(CentOS 精

CentOS系统下GitLab的备份与恢复策略为了保障数据安全和可恢复性,CentOS上的GitLab提供了多种备份方法。本文将详细介绍几种常见的备份方法、配置参数以及恢复流程,帮助您建立完善的GitLab备份与恢复策略。一、手动备份利用gitlab-rakegitlab:backup:create命令即可执行手动备份。此命令会备份GitLab仓库、数据库、用户、用户组、密钥和权限等关键信息。默认备份文件存储于/var/opt/gitlab/backups目录,您可通过修改/etc/gitlab

检查CentOS系统中HDFS配置的完整指南本文将指导您如何有效地检查CentOS系统上HDFS的配置和运行状态。以下步骤将帮助您全面了解HDFS的设置和运行情况。验证Hadoop环境变量:首先,确认Hadoop环境变量已正确设置。在终端执行以下命令,验证Hadoop是否已正确安装并配置:hadoopversion检查HDFS配置文件:HDFS的核心配置文件位于/etc/hadoop/conf/目录下,其中core-site.xml和hdfs-site.xml至关重要。使用

CentOS 中配置 IP 地址的步骤:查看当前网络配置:ip addr编辑网络配置文件:sudo vi /etc/sysconfig/network-scripts/ifcfg-eth0更改 IP 地址:编辑 IPADDR= 行更改子网掩码和网关(可选):编辑 NETMASK= 和 GATEWAY= 行重启网络服务:sudo systemctl restart network验证 IP 地址:ip addr

在CentOS上配置Hadoop分布式文件系统(HDFS)时,需要修改以下关键配置文件:core-site.xml:fs.defaultFS:指定HDFS的默认文件系统地址,例如hdfs://localhost:9000。hadoop.tmp.dir:指定Hadoop临时文件的存储目录。hadoop.proxyuser.root.hosts和hadoop.proxyuser.ro
