RHLCSA初步学习
- 如何在创建一个虚拟机后修改删除或修改root的密码?
1.Reboot the system.
2.Interrupt the boot loader count down by pressing anykey.
3.Move the cursor to the entry that needs to be booted.
4.Press “e” to edit the select edentry.
5.Move the cursor to the kernel command line(the line that start swith linux16.
6.Append rd.break.
7.Press Ctrl+x to start.
8.Remount /sysroot as read-write.
switch_root:/# mount -o remount,rw /sysroot
switch_root:/# chroot /sysroot
sh-4.2# passwd [root] (change the root password)
or
sh-4.2# passwd -d root (delete the root password)
sh-4.2# touch /.autorelabel
sh-4.2# exit
switch_root:/# exit
- 命令提示符的区分:#和$
$表示在普通用户之下,#表示在root用户之下
- 一些简单的命令
cd 切换目录(其中/是指根目录,~是指家目录)
cd ~ 切换到到家目录
cd ~+用户 直接切换到指定用户的家目录
cd - 在上一个目录与当前目录之间来回切换
su 切换用户
su - haha 切换用户环境
su haha 不切换用户环境
绝对路径 cd /home/redhat
相对路径:
cd /
cd home
cd redhat
. 当前目录
… 上级目录