20180910 single user and rescue mode, virtual machine cloning, Linux machine mutual login

Change root password in single user mode

When the system starts, press any key up or down in the direction, then select the first item and press the 'e' key to enter the boot script for editing

Then find the line at the beginning of Linux 16 for editing, and change ro to rw init=/sysroot/bin/sh

After the change, as shown in the figure below, press ctrl + x to enter the single user mode

Switch the current directory to the original system environment, change the password, and execute touch /.autorelabel to ensure the modification takes effect

After modification, you need a new password to log in after restart.

Rescue mode

First, the system is off. The virtual machine should be configured to ensure that the system is started through CD-ROM

After setting, start the system and enter BIOS to ensure the first boot of CD-ROM

After saving and exiting, enter the system again, and then select according to the following process

And then into rescue mode

Password change for rescue mode

Change complete, unset server to start from CD-ROM drive

After modification, you need a new password to log in after restart.

Virtual machine clone

Find the clone option from the menu

Next, go here and choose to create a link (for example, the figure is wrong)

Clone complete after setting name

Two Linux machines log in to each other

[root@centos0 ~]# ifconfig  # View the ip address of the current machine
eno16777736: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet  netmask  broadcast
        inet6 fe80::20c:29ff:fe7c:eea3  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:7c:ee:a3  txqueuelen 1000  (Ethernet)
        RX packets 2528  bytes 300943 (293.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1143  bytes 159686 (155.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

# Log in to machine  
[root@centos0 ~]# ssh root@ -p 22
root@'s password: # Enter the root password for the machine  

#Log in with key pair

#Generate key pair
[root@centos01 ~]# ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
4b:00:2f:2b:d1:2a:49:c8:fc:24:cf:36:be:d5:b1:55 root@centos01
The key's randomart image is:
+--[ RSA 2048]----+
|    .            |
|+  . o           |
|.=..o o    E     |
|..*o o .  .      |
|o o*.  .S.       |
| .o.. ..+.       |
|   . . o.        |
|    o            |
|   .             |
# Put the generated. ssh/id_rsa.pub on the server to log in to
[root@centos01 ~]# ssh root@ -p 22
Last login: Tue Sep 11 11:25:31 2018 from
# Direct login succeeded

Keywords: ssh Linux

Added by migmedia on Wed, 01 Jan 2020 19:39:05 +0200