Linux knowledge point Review: single-user mode, rescue mode, clone Virtual Machine and Linux machine logon explanation, linux knowledge point

Source: Internet
Author: User

Linux knowledge point Review: single-user mode, rescue mode, clone Virtual Machine and Linux machine logon explanation, linux knowledge point
1.13 single-user mode

In linux, when the password is forgotten, the password is changed (prerequisite: the password must be manually operated on a physical machine or server)

At the moment when the startup interface appears, press the up and down arrow keys, select the one above, and pressKey eEdit; (e is edit)Grub Interface(That is, find the boot disk in the system) and then press the downward direction key to findLinux16Click the right arrow key to locate the row.Ro(Ro indicates read only, read only) Change roRw init =/sysroot/bin/sh(Sysroot indicates the directory where the system is located, and the path where the original system is located) press ctrl + x to enter some commands (safe mode, but not yet into the system) (memory operating system) run the ls command to view and enterChroot/sysroot/Switch to the original system. When the entered command is garbled, useCtrl + cCancel the command and enterLANG = enTo define the language (the vm terminal does not support Chinese) and then passwd root to change the password. after entering the password twice, you can log on to the linux operating system using the password (key step ).Touch/. autorelabelIf you do not perform this operation, you may not be able to log on to the system and then restart the system with the power.

1.14 rescue mode

Before centos6, there were seven levels from 0 to 6

-0 Shutdown (Init 0)

-1 single-user mode

-Multi-user mode in the 2, 3, and 4 command lines (when the GUI is not installed normally, it enters level 3)

-5 graphic operation interface

-6 restart (Reboot)

Use a system disc or USB flash drive to enter the installation system interface.

1. First shut down, edit the virtual machine settings, and load the optical drive (connection at startup)

1. Then select "power" to "boot into BIOS (B)", let it load the optical drive at startup, set the optical drive to be the first boot object (the default setting is not to load the optical drive first)

1. Use the arrow keys to control, select boot, and then use plus or minus signs, adjust the CD-ROM Drive as the first startup object

1. Press F10, select yes, and press Enter.

1. The page is displayed, with three options available.

-First install the Operating System

-The second test is your optical drive.

-The third Troubleshooting Mode

1. Select the third Troubleshooting mode, select the interface, and select the second Rescue a CentOS Linux system

1. Press enter, and then press Enter. Three options are displayed.

-First resume

-Second read-only mounting

-The third one skips the shell (skip)

1. Select the first (continue), press the Enter key to get the shell, and enterChroot/mnt/sysimage/

1. EnterPasswd root, Enter the new password

1. Click the optical drive settings, cancel "connection at startup", and then "Power restart Virtual Machine ".

1.15 clone a VM

Shut down the VM before cloning.

1. Select virtual machine, in select Manage, in clone, create Link clone, rename hf-02

1. InVi/etc/sysconfig/network-scripts/ifcfg-ens33To delete the UUID row.

1. restart the network service systemctl restart network. service (the command not found is displayed if you have not restarted the network service)

1. ping the internet.

1. Set the clone server name. You can enter the hostname to view the name.

1. Enter hostnamectl set-hostname hf-02 to change the name

1. on the active host, change the hf host name hostnamectl set-hostname hf-01 to change the name

1. You can enter cat/etc/hostname to view the configuration file that is directly modified.

1. Open xshell, copy hf, change the name to hf-02, and modify the IP address (because it is copied, so the key exists)

1.16 login between Linux machines

WCommand to view the system load

Connect to another linux host using ssh with an IP address or ssh username @ IP (standard). If no user name is written, the user logged on to the current system is used by default.WhoamiCommand to view the user ssh-p 22 root@192.168.133.130 for the current system login specified port

KEY authentication between two linux systems

1.Ssh-keygenCommand to generate a key pair

1. Then press enter for the first time (specify the Save path)

1. Press enter again for the second time (the password is blank)

1. Press enter again for the third time (generate the key pair)

1.Ls/root/. sshCommand to view the public key and Private Key

1. UseCat/root/. ssh/id_rsa.pubCopy the public key content to the hf-01 (if the directory is not found, cd. ssh is supported)

1.Vi/root/. ssh/authorized-keysEdit File

First ## look at the hf-02

Save the public key in paste

UseGetenforceCommand check if the display is Enforcing, selinux firewall is enabled. We run the setenforce 0 command and then the getenforce command will display Permsddive, and selinux firewall is disabled.

SSH logon is too slow. Solution

To restart the sshd service, run the following command:Systemctl restart sshd

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.