C
C
Cyril2017-11-28 15:33:48
git
Cyril, 2017-11-28 15:33:48

Why does the ssh server still ask for a password?

Deployed a git repository on the development server. Created a git user on this server and gave it a password. I added a public key to the authorized_keys file so that you can connect to the server without a password.
On my home computer, I type ssh <development_server_address> in the terminal , but I still get a password prompt from the git user .
When I want to clone a git repository on my home computer, the same problem occurs.
PS: On my home computer I did eval $(ssh-agent -s) and ssh-add ~/.ssh/devserver in the terminal , but it still didn't help. Requests a password from the git user.
How can I make it so that I can clone a git repository on my home computer without asking for a password, but only by key? Thank you!
*UPDATE: In general, I recreated the git user and, without entering it, immediately set the rights:
1. sudo -u git chmod 700 /home/git/.ssh
2. sudo -u git chmod 600 /home/git/.ssh /authorized_keys
And only then you need to enter. After that everything worked. Thanks to all!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
Ivan Koryukov, 2017-11-28
@MadridianFox

Check that /etc/ssh/sshd_config is set to allow login by key
PubkeyAuthentication yes

B
Boris Syomov, 2017-11-28
@kotomyava

ssh -v -i ~/.ssh/devserver [email protected]<development_server_address>
This will make it much clearer what happens with authorization.
Further, where is your private key located locally?
What are the permissions on authorized_keys? authorized_keys is in .ssh/ in the user's home folder?
PS In general, it is convenient to transfer the key using ssh-copy-id.

K
Kirill Kublyakov, 2017-11-28
@Kublyakov

When creating a key, just do not specify a password)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question