Centos7.3 修改主机名,密码,删除多余用户

前端之家收集整理的这篇文章主要介绍了Centos7.3 修改主机名,密码,删除多余用户前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。


Centos7.3 修改主机名,密码,删除多余用户

[root@localhost ~]# uname -a
Linux localhost.localdomain 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core) 
#设置主机名
[root@localhost ~]# hostnamectl set-hostname  GE1CSH1V
[root@localhost ~]# hostname
ge1csh1v
#修改密码
[root@localhost ~]# passwd
Changing password for user root.
#输入新的密码
New password: 
#重新输入新密码
Retype new password: 
#密码:身份验证令牌更新成功。
passwd: all authentication tokens updated successfully.

3.删除多余的用户

#查询系统中有那些用户
[root@localhost ~]# cat /etc/shadow
root:$6$dDtmsj8w$7WTw4JxSGHO1DS0XzHCKgxZyIaVpmtfHpKTkp/PtS60uRD8xPbjxNMELK96hdcV96cmk6n2A6X7MUn8Fg4E4F1:17501:0:99999:7:::
bin:*:17110:0:99999:7:::
daemon:*:17110:0:99999:7:::
adm:*:17110:0:99999:7:::
lp:*:17110:0:99999:7:::
sync:*:17110:0:99999:7:::
shutdown:*:17110:0:99999:7:::
halt:*:17110:0:99999:7:::
mail:*:17110:0:99999:7:::
operator:*:17110:0:99999:7:::
games:*:17110:0:99999:7:::
ftp:*:17110:0:99999:7:::
nobody:*:17110:0:99999:7:::
systemd-bus-proxy:!!:17467::::::
systemd-network:!!:17467::::::
dbus:!!:17467::::::
polkitd:!!:17467::::::
abrt:!!:17467::::::
unbound:!!:17467::::::
tss:!!:17467::::::
libstoragemgmt:!!:17467::::::
rpc:!!:17467:0:99999:7:::
colord:!!:17467::::::
usbmuxd:!!:17467::::::
saslauth:!!:17467::::::
geoclue:!!:17467::::::
rtkit:!!:17467::::::
rpcuser:!!:17467::::::
nfsnobody:!!:17467::::::
radvd:!!:17467::::::
qemu:!!:17467::::::
ntp:!!:17467::::::
chrony:!!:17467::::::
setroubleshoot:!!:17467::::::
sssd:!!:17467::::::
pulse:!!:17467::::::
gdm:!!:17467::::::
gnome-initial-setup:!!:17467::::::
sshd:!!:17467::::::
avahi:!!:17467::::::
postfix:!!:17467::::::
tcpdump:!!:17467::::::
as:$6$h8hnOJhmBRbQrbeD$kzgler57IIGgKP3BGdjwkX2OCwO3J/atVkx6egznGot6kSJYC8hEWP5.3zYLyIWsckMgY8yyVblq0nCVOzln7.:17467:0:99999:7:::
#永久删除指定的用户
[root@localhost ~]# userdel as
#再次查询是否删除用户
[root@localhost ~]# cat /etc/shadow
root:$6$dDtmsj8w$7WTw4JxSGHO1DS0XzHCKgxZyIaVpmtfHpKTkp/PtS60uRD8xPbjxNMELK96hdcV96cmk6n2A6X7MUn8Fg4E4F1:17501:0:99999:7:::
bin:*:17110:0:99999:7:::
daemon:*:17110:0:99999:7:::
adm:*:17110:0:99999:7:::
lp:*:17110:0:99999:7:::
sync:*:17110:0:99999:7:::
shutdown:*:17110:0:99999:7:::
halt:*:17110:0:99999:7:::
mail:*:17110:0:99999:7:::
operator:*:17110:0:99999:7:::
games:*:17110:0:99999:7:::
ftp:*:17110:0:99999:7:::
nobody:*:17110:0:99999:7:::
systemd-bus-proxy:!!:17467::::::
systemd-network:!!:17467::::::
dbus:!!:17467::::::
polkitd:!!:17467::::::
abrt:!!:17467::::::
unbound:!!:17467::::::
tss:!!:17467::::::
libstoragemgmt:!!:17467::::::
rpc:!!:17467:0:99999:7:::
colord:!!:17467::::::
usbmuxd:!!:17467::::::
saslauth:!!:17467::::::
geoclue:!!:17467::::::
rtkit:!!:17467::::::
rpcuser:!!:17467::::::
nfsnobody:!!:17467::::::
radvd:!!:17467::::::
qemu:!!:17467::::::
ntp:!!:17467::::::
chrony:!!:17467::::::
setroubleshoot:!!:17467::::::
sssd:!!:17467::::::
pulse:!!:17467::::::
gdm:!!:17467::::::
gnome-initial-setup:!!:17467::::::
sshd:!!:17467::::::
avahi:!!:17467::::::
postfix:!!:17467::::::
tcpdump:!!:17467::::::
原文链接:https://www.f2er.com/centos/375143.html

猜你在找的CentOS相关文章