Y
Y
Yasuro2018-12-01 13:54:35
Computer networks
Yasuro, 2018-12-01 13:54:35

How to connect via git-bush or via the console from under Windows using an ssh key to the server?

Server on centos 6
What I do:
1) generate a public and private key in git-bush using the ssh-keygen.exe command with the name id_rsa, the
public and private keys fall into c:/users/alex/.ssh (home directory)
2) I copy id_rsa.pub to the server in the /home/userName/.ssh directory
3) I rename id_rsa.pub to 'authorized_keys'
in git-bush I go to the server via ssh [email protected] the server asks for a password.
What am I doing wrong?
git-bush just doesn't see the private id_rsa even though it's in the user's home directory.
ps. on the server in the /etc/ssh/sshd_config file, uncommented the lines:
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
Restarted the sshd service.
If you connect via putty using the built-in key generator and explicitly specifying where id_rsa.ppk is stored, then it successfully connects without asking for a password.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
res2001, 2018-12-01
@Yasuro

ssh server must be configured for key authentication. Password authentication is disabled.

PubkeyAuthentication yes
PasswordAuthentication no

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question