Linux telnet ssh password free

Source: Internet
Author: User
Tags system log

First, the question:

If we now have two machines: PCA and PCB, now we want to allow ServerA to access without entering a password.

two method and principle:

You can use ssh-keygen-t RSA to generate private and public keys on the PCA and copy the generated public key to the remote machine PCB On the back,

You can use the SSH command to log on to another machine PCB without a password.

In a Linux system, SSH is the default tool for remote logins, because the protocol of the tool uses the RSA/DSA encryption Algorithm " default is the DSR algorithm ",

This tool is very secure as a remote management of Linux systems.

Third , the experimental steps:

1 , login PCA

2.ssh-keygen-t RSA will generate the public and private key files Id_rsa.pub and Id_rsa

"Keep going, these two files should be under /home/$USER/.ssh ."

3 . Copy the id_rsa.pub file to the. SSH directory of the PCB machine and save it as Authorized_keys

You can usethe: Ssh-cop-id command to copy the specified public key file to the remote computer.

Ssh-copy-id-i id_rsa.pub [email protected]

4. When you are done, log in to the target account of the PCB machine from the PCA machine and no longer need the password.

5, set file and directory permissions "This step can be omitted, but for the sake of safety, plus is also necessary ~"

Set Authorized_keys Permissions

chmod 644 Authorized_keys

Set the. SSH directory permissions

chmod 700-r. SSH

6, to ensure that. ssh and Authorized_keys only the user has Write permission . Otherwise, validation is not valid.

(Today is the problem, looking for a long time the problem), in fact, think carefully, this is done so as not to appear system vulnerabilities.

Error:

The authenticity of host ' 192.168.127.150 (192.168.20. Max) ' Can ' t be established.
RSA Key fingerprint is 6a:37:c0:e1:09:a4:21:8d:68:d0:ca:21:20:94:be:11
Is you sure want to continue connecting (yes/no)? Yes
Warning:permanently added ' 192.168.127. Max' (RSA) to the list of known hosts.
[Email protected] Max' s Password:
Permission denied, please try again.
[Email protected]127. Max' s Password:
Permission denied, please try again.
[Email protected]127. Max' s Password:
Permission denied (Publickey,gssapi-with-mic,password).

7. If SSH wants to password-free login, simply execute copy id_rsa.pub Authorized_keys under the. ssh file.

Note:

1, if you add a public key, still cannot access, may be the PCA host above a file known_hosts already exists in the PCB IP information, remove the re-access can be.

2, if the above method after the attempt or not, it may be because the number of login failures are locked, this time you need to look at the system log/var/log/messages, will be deleted before the lock information log.

Good luck to you all!!!




Linux telnet ssh password free

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.