Linux -- 用户管理

一、Linux用户登录

1、打开Xshll 7 -> 点击文件 -> 点击新建

Linux -- 用户管理_第1张图片

 2、创建会话名称--主机位置填服务器的公网ip

Linux -- 用户管理_第2张图片

 Linux -- 用户管理_第3张图片

3、连接 

Linux -- 用户管理_第4张图片

 4、连接成功

Linux -- 用户管理_第5张图片

5、 增添一个名为 xxp 的新用户,必须以root身份来添加

[root@VM-24-3-centos lesson1]# adduser xxp
[root@VM-24-3-centos lesson1]# ls /home/      // 查看腾讯云建有多少用户
lighthouse  nice  xxp

6、为新添加的用户设置密码

[root@VM-24-3-centos lesson1]# ls /home/
lighthouse  nice  xxp
[root@VM-24-3-centos lesson1]# passwd xxp
Changing password for user xxp.
New password: 
BAD PASSWORD: The password contains the user name in some form
Retype new password: 
passwd: all authentication tokens updated successfully.
[root@VM-24-3-centos lesson1]# 

7、查看当前用户

[root@VM-24-3-centos lesson1]# whoami
root

8、删除用户

[root@VM-24-3-centos ~]# ls /home/
lighthouse  nice  xxp
[root@VM-24-3-centos ~]# userdel -r xxp
[root@VM-24-3-centos ~]# ls /home/
lighthouse  nice

9、命令行登录用户 

[xxp@VM-24-3-centos ~]$ ssh [email protected]
The authenticity of host '101.43.223.6 (101.43.223.6)' can't be established.
ECDSA key fingerprint is SHA256:0yx7XnH3pPmsr2JUyNt2HYNXnh9NAXYI099j2lzD2os.
ECDSA key fingerprint is MD5:f2:57:d1:de:63:48:b1:93:38:3e:1b:08:44:a8:8c:c8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '101.43.223.6' (ECDSA) to the list of known hosts.
[email protected]'s password: 
Last login: Sun Mar  6 16:49:07 2022 from 101.43.223.6
[xxp@VM-24-3-centos ~]$ whoami
xxp

★★★★★ 感谢阅读!

你可能感兴趣的:(Linux,linux,服务器)