Linux first week study notes (TEN)
1.15 Cloning a virtual machine
(1) because in the future to do the experiment requires two machine interconnection, because in the virtual machine inside the system is slower so the use of cloning is relatively simple, that is, the original good system to make a copy intact.
(2) Cloning a virtual machine
First step: Close the virtual machine before cloning
Step two: Start cloning a virtual machine
Step three: Set up the 2nd virtual Machine Network (because it is a clone, you need to modify the IP address or the two simulator IP will conflict)
Log in to number 2nd virtual machine
Remove the UUID (if you do not delete this line will conflict with the number 1th), after the change, press "ESC" key to exit the edit, enter ": Wq" Save and exit
Fourth step: View and modify the host name of Virtual Machine No. 1th and number 2nd virtual machine
Change the 1th virtual machine hostname, type the command: Hostnamectl set-hostname daizhihong-01, the modification is successful (the revision process as above, not repeat here)
Fifth step: Set up the Xshell connection 2nd number virtual machine
1.16 Linux machines log in to each other
(1). Password Login
The first step: 1th virtual Machine Login 2nd virtual machine, using SSH 192.168.226.11, login success
Step Two: Number 2nd virtual machine login 1th virtual machine, type command: SSH 192.168.226.10, login successful
An explanation of SSH commands
Standard format: SSH [email protected]
Example: SSH [email protected]
Specify port connection: ssh-p [email protected] (p specify port parameter, 22 port number)
(2). Using key authentication
Number 2nd virtual Machine Connection 1th virtual machine (public key is placed on number 1th, private key is placed on number 2nd virtual machine)
First step: Generate a key pair on the 2nd virtual machine, type the command: Ssh-keygen, press ENTER to prompt: Enter file in which to save the key (/ROOT/.SSH/ID_RSA): Define the storage path of the key pair, keep the default press ENTER to continue
Step two: prompt: Enter passphrase (empty for no passphrase): Set the key to open password, set open press Password to empty press ENTER to continue
The third step: continue to press ENTER, generate key pairs, generated after the following prompt:
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:
Sha256:qpigmw+cldx6a3jje+0ls3ateplyzcvylqvjke4mdeu [email protected]
The key ' s Randomart image is:
+---[RSA 2048]----+
| ... |
| ... . |
| =e. . . |
| = B + =. |
|. O * = S * o |
|*o = * =. |
|. *. o *o*. |
| + + =+* |
| .. . o=.o |
+----[SHA256]-----+
Fourth step: View the Public key file name, type: ls. root/.ssh0/command
Authorized_keys Id_rsa id_rsa.pub known_hosts
Id_rsa: Private key
Id_rsa.pub: Public Key
Fifth step: Type: cat/root/.ssh/id_rsa.pub command to view the public key and copy
Sixth step: Open the 1th virtual machine run the Edit key file, type: Vi/root/.ssh/authorized_keys command to edit the key file
Seventh Step: Number 2nd virtual machine login with key, type: ssh-p [email protected], login successful
- ---------------------------------------------------------------- command and use summary -------------------------------------- --------------------------
You can use the "w" command to view the system load and to reflect the number of connections
An explanation of SSH commands:
Standard format: SSH [email protected]
Example: SSH [email protected]
Specify port connection: ssh-p [email protected] (p specify port parameter, 22 port number)
Generate key Pair command: Ssh-keygen
Cat/root/.ssh/id_rsa.pub command to view the public key and copy
View current logged on user command: Whoam
Change host name, type command: Hostnamectl set-hostname daizhihong-01
Query host Name: type command: hostname
Linux first week study notes (10)