ubuntu 16.04 64bit telnet服务搭建。
1、安装:
默认源没有xinetd等软件包,所以要更新源:
1 | sudo apt-get update |
2、配置
修改文件 /etc/xinetd.conf
(xinetd默认为此文件):
1 | # new add by Late Lee |
3、修改端口
修改/etc/services
,将telnet的23改为其它的不冲突的端口号,如250。
4、重启
1 | /etc/init.d/xinetd restart |
5、登陆
命令:
1 | telnet ip 端口号 |
6、允许root登陆
ubuntu不允许root用户用telnet来登陆,但可以使用非root用户,与ssh类似。
如果一定要用root登陆,方法有2种:
6.1、将/etc/securetty文件改名
6.2、在/etc/securetty文件最后添加
1 | # add pts by Late Lee |
说明: securetty文件规定了root可以从哪些终端登陆,像ssh、telnet等是用伪终端pts,另外该文件还有如标准终端的tty*(按Ctrl+Alt+数字登陆)、串口ttyS、ttyUSB、ttyO*(OMAP系的串口),等等