ubuntu 开启telnet服务并添加可以用于登录的用户

问题描述

新部署了一个Ubuntu服务器,可以通过ssh登录,但是不能telnet。通过ssh安装了telnet服务能telnet上,但是一直无法通过root登录,在新建了用户之后,用新的用户名和密码成功登录。所以对于新的设备来说,要想成功telnet远程服务器需要至少以下两步。

先添加用户

在管理员模式下输入 useradd choudan,然后输入两次密码即可创建成功

:~# adduser choudan
Adding user `choudan' ...
Adding new group `choudan' (1000) ...
Adding new user `choudan' (1000) with group `choudan' ...
Creating home directory `/home/choudan' ...
Copying files from `/etc/skel' ...
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully
Changing the user information for choudan
Enter the new value, or press ENTER for the default
        Full Name []: 
        Room Number []: 
        Work Phone []: 
        Home Phone []: 
        Other []: 
Is the information correct? [Y/n] Y

安装telnet服务

apt install telnetd

测试

Ubuntu 18.04.4 LTS                                                          
iZj6c4a5lyjvcskaf9sodnZ login: choudan                                      
Password:                                                                   
Welcome to Ubuntu 18.04.4 LTS (GNU/Linux 4.15.0-96-generic x86_64)          
* Documentation:  https://help.ubuntu.com                                   
* Management:     https://landscape.canonical.com                           
* Support:        https://ubuntu.com/advantage                              
* MicroK8s passes 9 million downloads. Thank you to all our contributors!   
https://microk8s.io/                                                        
* Canonical Livepatch is available for installation.                        
- Reduce system reboots and improve kernel security. Activate at:           
https://ubuntu.com/livepatch                                                
The programs included with the Ubuntu system are free software;             
the exact distribution terms for each program are described in the          
individual files in /usr/share/doc/*/copyright.                             
Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by        
applicable law. 
Welcome to Alibaba Cloud Elastic Compute Service !                          
To run a command as administrator (user "root"), use "sudo <command>".      
See "man sudo_root" for details.                                            
choudan@iZj6c4a5lyjvcskaf9sodnZ:~$                                          
choudan@iZj6c4a5lyjvcskaf9sodnZ:~$ 

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值