First to popularize a life-saving knowledge point-snapshot function:
disk "Snapshot" is Virtual Machines Disk File (VMDK) at some point in a timely copy ( System Restore points similar to Windows ). system crashes or system exceptions, you can recover disk File system and system storage by using revert to snapshot. When upgrading applications and servers and patching them, snapshots are the Savior! ( It is recommended to create a write snapshot later )
To create a new snapshot:
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/97/7D/wKioL1kuw2bgy0pCAAFXZb6YQKI379.png "style=" float : none; "title=" 1.png "alt=" Wkiol1kuw2bgy0pcaafxzb6yqki379.png "/>
Restore the system to a restore point:
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/97/7C/wKiom1kuw2fh7cJwAAF56LtMkbw393.png "style=" float : none; "title=" 2.png "alt=" Wkiom1kuw2fh7cjwaaf56ltmkbw393.png "/>
Change this to see more command history:
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/97/7C/wKiom1kuxN6Ddsi7AABUnDkqzcE291.png "title=" 20170531212735.png "alt=" Wkiom1kuxn6ddsi7aabundkqzce291.png "/>
Change this to prevent garbled characters:
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/97/7C/wKiom1kuw2rAeCtTAAJZ9gSl8Wk544.png "style=" float : none; "title=" 4.png "alt=" Wkiom1kuw2raecttaajz9gsl8wk544.png "/>
Putty key authentication
First Open Puttygen
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M00/97/7D/wKioL1kuxYajkxAVAAAURG3xFC8115.png "style=" float : none; "title=" 5.png "alt=" Wkiol1kuxyajkxavaaaurg3xfc8115.png "/>
Click on the Generate (here you should keep shaking the mouse in the operating screen so that you can create faster)
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/97/7D/wKioL1kuxYeAxecZAADWhGpYnF0396.png "style=" float : none; "title=" 6d.png "alt=" Wkiol1kuxyeaxeczaadwhgpynf0396.png "/>
Then create the password and save the private key to the local hard disk
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/97/7C/wKiom1kuxYihiiWwAADnbCWNgHM464.png "style=" float : none; "title=" 7d.png "alt=" Wkiom1kuxyihiiwwaadnbcwnghm464.png "/>
Then go back to the Linux system again and log in once and enter as follows:
#mkdir/root/.ssh Create a hidden folder for. SSH
#chmod 700/root/.ssh folder authorization to. SSH
#vi/root/.ssh/authorized_keys Copy the public key to this file
Copy the public key in the following box
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M02/97/7D/wKioL1kuxYmiL_W0AADmkqBHFmI879.png "style=" float : none; "title=" 8d.png "alt=" Wkiol1kuxymil_w0aadmkqbhfmi879.png "/>
paste in this file, Note that you must first press the letter I key and then right-click!
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/97/7D/wKioL1kuxkChx2YaAAB5wUy_t5I058.png "style=" float : none; "title=" 9d.png "alt=" Wkiol1kuxkchx2yaaab5wuy_t5i058.png "/>
Then close the current window (ctrl+d) to
Log in again, load the account, and then go to SSH.
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/97/7C/wKiom1kuxkHRJLU1AADUixr383Q497.png "style=" float : none; "title=" 10d.png "alt=" Wkiom1kuxkhrjlu1aaduixr383q497.png "/>
Continue to click Auth to browse the public key we have just saved
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/97/7D/wKioL1kuxkKB59iyAADMroJ09pA228.png "style=" float : none; "title=" 11d.png "alt=" Wkiol1kuxkkb59iyaadmroj09pa228.png "/>
Then return to the session again and click Save!
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/97/7D/wKioL1kuxkOC9pZYAADSP0nartA563.png "style=" float : none; "title=" 12d.png "alt=" Wkiol1kuxkoc9pzyaadsp0narta563.png "/>
Enter the user name below we enter just the password we entered, successfully entered!
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/97/7C/wKiom1kuxkTR3XNxAABWzqOslgM632.png "style=" float : none; "title=" 13d.png "alt=" Wkiom1kuxktr3xnxaabwzqoslgm632.png "/>
Xshell key authentication
1. Open Xshell interface, tools → new user key generation wizard
650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M00/97/7E/wKioL1kuyEay_R1HAABzbxCj5_E848.png-wh_500x0-wm_ 3-wmp_4-s_3303285714.png "title=" Rd.png "alt=" Wkiol1kuyeay_r1haabzbxcj5_e848.png-wh_50 "/>
2. Key type select RSA, key length Select 2048 bit, click Next to continue
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/97/7C/wKiom1kuyBfgcX5SAACZXbwjFa8847.png "style=" float : none; "title=" 15d.png "alt=" Wkiom1kuybfgcx5saaczxbwjfa8847.png "/>
3. Generate the public key pair soon, click Next to continue
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M00/97/7E/wKioL1kuyBiz8ptoAACPJX7NSlA564.png "style=" float : none; "title=" 16d.png "alt=" Wkiol1kuybiz8ptoaacpjx7nsla564.png "/>
4, the key name can be customized, a name you understand, or leave the default, enter the key encryption password for remote login
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/97/7E/wKioL1kuyBmBcGXVAADVBGnWCzo758.png "style=" float : none; "title=" 17d.png "alt=" Wkiol1kuybmbcgxvaadvbgnwczo758.png "/>
5, copy the generated public key, or save as a file, complete the key generation.
6. Then use the #vi/root/.ssh/authorized_keys again and copy the Xshell's public key to another line, starting with the # Sign in Linux is labeled in the meaning!
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/97/7C/wKiom1kuyBqRDYKCAADLiAK8HoM497.png "style=" float : none; "title=" 18d.png "alt=" Wkiom1kuybqrdykcaadliak8hom497.png "/>
7. Open a new Xshell window again, click Properties!
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/97/7C/wKiom1kuyBuxhdjKAAB3XaqbheY396.png "style=" float : none; "title=" 19d.png "alt=" Wkiom1kuybuxhdjkaab3xaqbhey396.png "/>
8, such as Operation
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M02/97/7E/wKioL1kuyByQGXZYAADNhR3NSnQ511.png "style=" float : none; "title=" 20d.png "alt=" Wkiol1kuybyqgxzyaadnhr3nsnq511.png "/>
9, enter the password, click on the bottom left to remember the password, and then each entry can not need to enter any password! (Note: This risk is the future if you really need a password, long-term do not enter the password easy to forget it is not good to get, so we recommend that you download a keepass to help you save all the passwords)
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M00/97/7C/wKiom1kuyB3SrACDAACMARKVglM311.png "style=" float : none; "title=" 21d.png "alt=" Wkiom1kuyb3sracdaacmarkvglm311.png "/>
10, then the last step, we configured the firewall is only temporarily shut down, restart the computer will expire, so I need to permanently shut it
#vi/etc/selinux/config #修改selinux的配置文件
change "selinux=enforcing" to selinux= Disabled Save exit.
#iptables-F Purge rule
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/97/7E/wKioL1kuyB7hi1BNAABtDrwxZSo059.png "style=" float : none; "title=" 22d.png "alt=" Wkiol1kuyb7hi1bnaabtdrwxzso059.png "/>
When the next time, single-user mode, I will be my own careless caused by a fatal mistake to share!!!
Carefully! Carefully!! Carefully!!!
This article is from the "Old seven Linux Operations Management" blog, please be sure to keep this source http://asd9577.blog.51cto.com/4291946/1931131
Putty, Xshell key authentication login Linux