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的用戶名的賬號的密碼,即可。
兩者其實是一樣的。
