Prevent remote password interception decoding, SSH authentication and normal User login

Source: Internet
Author: User

Add Users:

Useradd Yang

Generate secret Key

[[email protected]/]$ ssh-keygen-t RSA

Generating public/private RSA key pair.

Enter file in which to save the key (/HOME/YANG/.SSH/ID_RSA):

Enter passphrase (empty for no passphrase): 123456

Enter same Passphrase again:123456

Your identification has been saved In/home/yang/.ssh/id_rsa.

Your public key has been saved in/home/yang/.ssh/id_rsa.pub.

The key fingerprint is:

1d:1d:97:0c:c0:40:8f:a4:1a:b9:93:71:03:7a:d4:[email protected]

The key ' s Randomart image is:

+--[RSA 2048]----+

| O.. +o. Oo.. |

| OO.o O.. oo |

| .=.+ .    O. |

| .. B ... |

|  =.      S. |

| E. |

| |

| |

| |

+-----------------+

Modify Permissions:

[Email protected] yang]# chmod. SSH

[[Email protected] yang]# CD. SSH

[email protected]. ssh]# LL

Total dosage 8

-RW-------1 Yang Yang 1743 7 months 03:22 id_rsa

-rw-r--r--1 Yang Yang 408 7 months 03:22 id_rsa.pub

[email protected]. ssh]# MV Id_rsa.pubauthorized_keys

[email protected]. ssh]# chmod 600authorized_keys

Copy the private key out

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6F/A5/wKiom1WjpInym1bkAAPQdNTA1Gs435.jpg "style=" float: none; "title=" 1.png "alt=" Wkiom1wjpinym1bkaapqdnta1gs435.jpg "/>




Modify The SSH configuration file

Vim/etc/ssh/sshd_config

42:permitrootlogin No # disable root login

47:rsaauthentication Yes #RSA validation

48:pubkeyauthentication Yes # public key validation

49:authorizedkeysfile. Ssh/authorized_keys # load secret key

66:passwordauthentication No # disable password login

Restart SSH

Service sshd Restart

Xshell Login

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6F/A5/wKiom1WjpIny-LqBAAFssAQdT_Q736.jpg "title=" 2.png " Style= "Float:none;" alt= "wkiom1wjpiny-lqbaafssaqdt_q736.jpg"/>

Import a newly copied private key

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6F/A2/wKioL1WjpmCQKlKSAAF9ixQjj5k797.jpg "title=" 3.png " Style= "Float:none;" alt= "wkiol1wjpmcqklksaaf9ixqjj5k797.jpg"/>

Enter Password login

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6F/A2/wKioL1WjpmGQibdwAADzKHpV29g547.jpg "title=" 4.png " Style= "Float:none;" alt= "wkiol1wjpmgqibdwaadzkhpv29g547.jpg"/>


Prevent remote password interception decoding, SSH authentication and normal User login

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.