Linux ssh password-less access (1)

Source: Internet
Author: User

Linux ssh password-less access is implemented by the configuration at both ends of the server and client. This section first introduces the configuration at the server end. This article is summarized in an online article. I hope this article will help you learn more.

The server name is s. The client name is c.

1. Generate a key pair. For the sake of simplicity, generate it on c. I will use root for the next operation. You can also use common users.
Ssh-keygen-t dsa
Ssh-keygen-t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/root/. ssh/id_dsa ):
Enter passphrase (empty for no passphrase ):
Enter same passphrase again:
Your identification has been saved in/root/. ssh/id_dsa.
Your public key has been saved in/root/. ssh/id_dsa.pub.
The key fingerprint is:
C3: 84: 4d: 24: 64: c4: 9d: 2b: 76: 1a: 6f: 7e: dc: 1a: 60: 23 root @ fedora3
Id_dsa is the private key, id_dsa.pub is the public key, and the private key is kept locally on the client. The public key is copied to the server you want to log on to through ssh.

2. Configure the Public Key
Copy the public key on c to server
Scp ~ /. Ssh/id_dsa.pub a:/tmp
Ssh
Cat/tmp/id_dsa.pub> ~ /. Ssh/authorized_keys
Rm-rf/tmp/id_dsa.pub
At this time, you can use a key pair to authenticate a from c.
3. Configure logon without a password
Run
Eval 'ssh-agent'
Edas Agent pid 6054
'Is the key above the TAB key, not a single quotation mark
Then execute
Ssh-add
Ssh-add
Enter passphrase for/root/. ssh/id_dsa: Enter the password of the key pair
Identity added:/root/. ssh/id_dsa (/root/. ssh/id_dsa)

Then you can access a through ssh without a password from c. In this way, we have completed the Linux ssh password-less access server configuration.

  1. Solve Linux garbled characters
  2. Linux link file type
  3. Comprehensive Analysis of Linux clock
  4. Detailed analysis of Linux password cracking Problems
  5. View All Linux hardware information

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.