0、准备工作,创建一个新的账号,此处为nication
telnet
1、安装软件:sudo apt install telnet telnetd openbsd-inetd
2、修改配置文件 无需修改配置文件
3、启动服务: sudo service openbsd-inetd restart
4、使用guochaoxxl账户telnet登录nication
1 guochaoxxl@DESKTOP-UJQD5G6:~$ telnet 127.0.0.1 2 Trying 127.0.0.1... 3 Connected to 127.0.0.1. 4 Escape character is '^]'. 5 Ubuntu 20.04.3 LTS 6 DESKTOP-UJQD5G6 login: nication 7 Password: 8 Welcome to Ubuntu 20.04.3 LTS (GNU/Linux 4.4.0-19041-Microsoft x86_64) 9 10 * Documentation: https://help.ubuntu.com 11 * Management: https://landscape.canonical.com 12 * Support: https://ubuntu.com/advantage 13 14 System information as of Fri Dec 10 21:23:03 CST 2021 15 16 System load: 0.52 Processes: 22 17 Usage of /home: unknown Users logged in: 0 18 Memory usage: 61% IPv4 address for eth0: 192.168.1.13 19 Swap usage: 2% 20 21 22 0 updates can be applied immediately. 23 24 25 *** System restart required *** 26 Last login: Fri Dec 10 16:01:12 CST 2021 from localhost on pts/0 27 nication@DESKTOP-UJQD5G6:~$
很明显可以看出用户由第一行guochaoxxl变成第27行的nication,中间需要输入要telnet的用户名的账号名和密码,即可。
ssh
1、安装软件: sudo apt install ssh openssh-server
2、修改配置文件 sudo vim /etc/ssh/sshd_config
将PasswordAuthentication no 改为PasswordAuthentication yes 启动密码登录,否则比较麻烦
3、启动服务: sudo service ssh restart
4、使用guochaoxxl账户telnet登录nication
1 guochaoxxl@DESKTOP-UJQD5G6:~$ ssh nication@127.0.0.1 2 nication@127.0.0.1's password: 3 Last login: Fri Dec 10 21:23:09 2021 from localhost 4 nication@DESKTOP-UJQD5G6:~$
很明显可以看出用户由第一行guochaoxxl变成第4行的nication,中间需要输入要ssh的用户名的账号的密码,即可。
两者其实是一样的。