[root@localhost~]# 用户名@主机名 家目录 #管理员 $普通用户
[root@192 /]# su root
[root@A /]# pwd
/
[root@A /]# su -l wc
[wc@A ~]$ pwd
/home/wc
[root@192 ~]# cd .
[root@192 ~]# cd ..
[root@192 ~]# cd -
/
[root@192 /]# hostname
192.168.71.134
[root@192 /]# hostname A
[root@192 /]# hostnamectl set-hostname A
[root@192 /]# whoami
root
[root@192 /]# passwd
Changing password for user root.
New password:
[root@192 /]# passwd -d USERNAME
[root@A etc]# cat /etc/redhat-release
Red Hat Enterprise Linux release 8.5 (Ootpa)
[root@A etc]# uname -r
4.18.0-348.el8.x86_64
[root@A etc]# uname
Linux
[root@A etc]# pstree
root@A etc]# tty
/dev/pts/1


mount -o remount,rw /sysroot
chroot /sysroot
第一种写法
passwd root
第二种写法
echo redhat | passwd --stdin root
New password:
Retype new passwd:
显示下面表示成功
passwd: all authentication tokens updated successfully/
touch /.autorelabel
sh-4.4# exit
exit
