如何在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中文网其他相关文章!

查版本号的命令:1、“cat /etc/issue”或“cat /etc/redhat-release”,可输出centos版本号;2、“cat /proc/version”、“uname -a”或“uname -r”,可输出内核版本号。

centos重启网卡的方法:1、对于centos6的网卡重启命令是“service network restart”;2、对于centos7的网卡重启命令是“systemctl restart network”。

centos php安装opcache的方法:1、执行“yum list php73* | grep opcache”命令;2、通过“yum install php73-php-opcache.x86_64”安装opcache;3、使用“find / -name opcache.so”查找“opcache.so”的位置并将其移动到php的扩展目录即可。

centos离线安装mysql的方法:1、将lib中的所有依赖上传到linux中,并用yum命令进行安装;2、解压MySQL并把文件复制到想要安装的目录;3、修改my.cnf配置文件;4、复制启动脚本到资源目录并修改启动脚本;5、将mysqld服务加入到系统服务里面;6、将mysql客户端配置到环境变量中,并使配置生效即可。

centos7安装不出现界面的解决办法:1、选择“Install CentOS 7”,按“e”进入启动引导界面;2、 将“inst.stage2=hd:LABEL=CentOS\x207\x20x86_64”改为“linux dd”;3、重新进入“Install CentOS 7”,按“e”将“hd:”后的字符替换成“/dev/sdd4”,然后按“Ctrl+x”执行即可。

centos删除php的方法:1、通过“#rpm -qa|grep php”命令查看全部php软件包;2、通过“rpm -e”命令卸载相应的依赖项;3、重新使用“php -v”命令查看版本信息即可。

方法:1、利用“vim ~/.bashrc”编辑用户目录(~)下的“.bashrc”文件;2、在文件内添加“alias ls="ls --color"”;3、利用“:wq!”命令保存文件内的更改;4、“exit”命令退出终端后重新连接即可。

我们的PC中有一个磁盘驱动器专门用于所有与Windows操作系统相关的安装。该驱动器通常是C驱动器。如果您还在PC的C盘上安装了最新的Windows11操作系统,那么所有系统更新(很可能是您安装的所有软件)都会将其所有文件存储在C盘中。因此,保持此驱动器没有垃圾文件并在C驱动器中拥有足够的存储空间变得非常重要,因为该驱动器拥有的空间越多,您的Windows11操作系统运行起来就越顺畅。但是您可以在磁盘驱动器上增加多少空间以及可以删除多少文件是有限制的。在这种情况下,


热AI工具

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

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

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

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

热门文章

热工具

WebStorm Mac版
好用的JavaScript开发工具

mPDF
mPDF是一个PHP库,可以从UTF-8编码的HTML生成PDF文件。原作者Ian Back编写mPDF以从他的网站上“即时”输出PDF文件,并处理不同的语言。与原始脚本如HTML2FPDF相比,它的速度较慢,并且在使用Unicode字体时生成的文件较大,但支持CSS样式等,并进行了大量增强。支持几乎所有语言,包括RTL(阿拉伯语和希伯来语)和CJK(中日韩)。支持嵌套的块级元素(如P、DIV),

Dreamweaver CS6
视觉化网页开发工具

PhpStorm Mac 版本
最新(2018.2.1 )专业的PHP集成开发工具

MinGW - 适用于 Windows 的极简 GNU
这个项目正在迁移到osdn.net/projects/mingw的过程中,你可以继续在那里关注我们。MinGW:GNU编译器集合(GCC)的本地Windows移植版本,可自由分发的导入库和用于构建本地Windows应用程序的头文件;包括对MSVC运行时的扩展,以支持C99功能。MinGW的所有软件都可以在64位Windows平台上运行。