SSH password-free login and principles


Generally, when we connect to a remote server, there are two ways.
1, the user name password, this way when each connection must enter a user name and password, too much trouble, it is not safe.
2, SSH key free password, use ssh to connect to remote server more secure, and do not enter a user name and password, simple number.

This blog mainly on the password-free login and SSH key principles

Generate public and private key Windows system

1, in the Windows system using SSH key Xshell client through the password-free login Linux servers.
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Generated key stored in the path you just selected.
Here Insert Picture Description

Generate public and private key under a Linux system

Execute cd ~/.ssh/commands, into the .ssh directory.
Here Insert Picture Description
Files in to view this directory ll
Here Insert Picture Description
only one file.
Next we use ssh-keygento generate public and private key
Here Insert Picture Description
in a file in to view this directory ll
Here Insert Picture Description
to generate a public and private key, then explain how to use them free password

Under Windows login password using ssh key free

We need to generate a public key on the Linux server ~ / .ssh / authorized_keys file.
Since there is no authorized_keys files in ~ / .ssh / directory, we first create the file:
Touch authorized_keys
Here Insert Picture Description
edit authorized_keys -> vim authorized_keys, and then copy paste the public key into it.

Use Xshell configure ssh key free password
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description

Published 25 original articles · won praise 6 · views 4506

Guess you like

Origin blog.csdn.net/weixin_44176169/article/details/103972257