dhclient 地址请求(网络连接)
#dhclient
ifconfig 或 ip a 查看ip地址

Kill ID 结束相应的进程

pwd 指出当前工作环境 --> print workdoing directory

hostname 查看完整主机名

hostname A 当前主机运行状态临时更改主机名

hostnamectl set-hostname A 永久更改主机名(重启生效)
su 切换到root用户并不切换环境(工作目录) --> switch user
su redhat 切换root身份,但不切换

su -
su -l root ==su - root 切换到root用户并切换环境(切换了工作目录)
cd 切换目录 change directory 切换目录【文件夹】
绝对路径 从根开始到目标的路径叫绝对路径 cd/home/redhat
相对路径 相对当前目录开始到目标路径 /]#cd root
/ 根
~ 家目录 /root/home/redhat
·USERNAME(root用户有权限) 直接切换到指定用户的家目录
-上一次切换的目录
. 当前目录.
passwd;password
修改密码:passwd 用户名 直接输入passwd修改当前用户的密码
删除密码:passwd -d 用户名
root用户:不需要输入原始密码,可以不符合密码复杂性规则,可以给任何人修改密码
普通用户:需要输入原始密码,必须符合密码复杂性规则,passwd修改密码无法指定用户

>>破解密码(重置密码)
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
9.Switch into a chroot jail, where /sysroot is treated as the root of the filesystem tree
switch_root:/# chroot /sysroot
10.Set a new root password:
sh-4.2# passwd [root] (change the root password)
or
sh-4.2# passwd -d root (delete the root password)
11.Make sure that all unlabeled files (including/etc/shadow at this point)get relabeled during boot.
sh-4.2# touch /.autorelabel
12. sh-4.2# exit
13. switch_root:/# exit
eg:破解root密码:
1、重启虚拟机 + e
2、在linux末尾加上 rd.break ctrl+x执行
3、mount -o remount,rw /sysroot (根分区 给根系统一个读写权限)
4、chroot /sysroot
5、passwd root 或passwd -d root
6、输入新密码:
7、确认密码
8、touch /.autorelabel 盖章
9、exit
10、exit logout
重启:reboot ,shutdown -r now
关机:shutdown -h now,poweroff init 0 init 3 init 5 init 1
查看当前Linux发行版本信息:cat /etc/redhat-release

远程登陆
ssh+IP地址
选择用户
输入密码




本文记录了RHCSA操作系统的常用命令,包括获取网络地址的dhclient、查看IP的ifconfig或ip a,以及进程管理、切换用户、修改主机名、密码管理等操作。此外,还详细介绍了如何破解或重置root密码的步骤。
558

被折叠的 条评论
为什么被折叠?



