Using public key to solve Linux git clone git library need to enter a password problem __linux

Source: Internet
Author: User
Tags chmod ssh git clone

To create a certificate login:

Collects the public key of all users who need to log in, the public key is in the Id_rsa.pub file, and imports our public key into the/home/git/.ssh/authorized_keys file of the Linux server where the Git library resides, one line.

If you do not have the file, you create it and modify the permissions for the corresponding file:

$ cd/home/git
$ mkdir. SSH $ chmod. SSH $ touch
. Ssh/authorized_keys
$ chmod

Public and private keys on the user:

1. First check if it is available.

$ cd ~/.ssh
$ ls

Look for files named Id_rsa and Id_rsa, one is. pub extension (public key), and the other is the private key.
2. If not, use Ssh-keygen to create, press ENTER continuously, indicating that the password is not entered when using the private key.
2 Files Id_rsa and id_rsa.pub (public key) are generated under. ssh.
Special attention points:

The warehouse on 1.git will have write permission to git user, and need to open RSA authentication in/etc/ssh/sshd_config, i.e.

Rsaauthentication Yes
pubkeyauthentication Yes
authorizedkeysfile. Ssh/authorized_keys

2./home/git belongs to the GIT user and has a privilege of 755 or drwxr-xr-x.
3. Ensure that the id_rsa.pub (public key) for each user in the. Ssh/authorized_keys begins with Ssh-rsa.

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.