1.13 单用户模式 1、忘记root的密码怎么办 a、重启linux reboot / init 6/ shutdown -r now 关机 init 0 /poweroff

1 make the command "init 6” to reboot the Centos system,and then click Centos, click button “e" to modify the grub mode 2 change ro to rw, add “init= /sysroot/bin/sh"

see image as below

2 chroot 命令用来在指定的根目录下运行指令。chroot,即change root directory(更改root目录)。在Linux系统中,系统默认的目录结构都是以/,即是以根(root)开始的。而在使用chroot之后,系统的目录结构将以指定的位置作为/位置 chroot /sysroot/

see image as below

3 passwd root exit blank as below is 使用LANG = en 密码出现乱码,需要把语言调整英文

在登录系统之前,必须完成这条命令,否则没办法登录系统 touch / .autorelabel

1.15 克隆虚拟机 使用虚拟机UI进行克隆虚拟机

  1. 修改ip地址,如图所示 第一步:(修改ip的路径) 第二步:(把UUID删掉,修改ip) 第三步:修改成功后,重启server,ping一下外网地址看是否是通的;

  2. 修改主机名 修改后重新登录server,看是否生效

3.使用xshell把两个ip链接起来 通过软件UI实现

1.16 Linux机器相互登录 w 命令是查看系统负载的。

  1. 查看当前用户是谁
  2. 远程登录,指定端口 3.在一台server上生成密钥对 4.把02server的public key copy到关联的01的authorized_keys里 再次登录02server,可以不用输入密码,密钥登录

?用getenforce看一下机器是否是开启的 用setenforce 0暂时关闭