Connect trough Cygwin without being asked for password

1

I'm trying to connect to a remote machine using Cygwin, the connection is successful problem is that it always asks me for the password.

ssh -i ~/.ssh/id_rsa -o "StrictHostKeyChecking no" user@machine.net 'echo test'

Do you know How I can login to remote server using Cygwin without password getting asked?

BTW - I tried to put the private key from the remote machine on the Cygwin machine, Added the remote machine to the known_host file

Shachar Hamuzim Rajuan

Posted 2016-05-23T10:20:44.220

Reputation: 111

Answers

1

I tried to put the private key from the remote machine on the Cygwin machine,

The private key isn't automatically useful; you also need to add its corresponding public key (usually the id_rsa.pub file) to the remote machine's ~/.ssh/authorized_keys file.

In other words, you need to explicitly tell the remote machine "this private key is acceptable".

Added the remote machine to the known_host file

That has nothing to do with passwords, does it? known_hosts is about authenticating the server to user, not the user to server.

user1686

Posted 2016-05-23T10:20:44.220

Reputation: 283 655

First of all thanks for the reply, So in my private user .ssh folder (C:\Users\Private_user.ssh) I should have: id_rsa (the private key from client/remote machine) , known_hosts , authorized_keys (With the public key from client/remote machine in it )? is that enough for "silent" login? and if I'm using CYGWIN as I mentioned should I put this .ssh folder inside: C:\cygwin64\home\Private_user.ssh ? – Shachar Hamuzim Rajuan – 2016-05-23T11:57:57.833

On the client, you need the id_rsa file (and optionally its corresponding id_rsa.pub). On the server, you don't need any private keys – only authorized_keys with a copy of the public key. (I'm not sure how Cygwin paths translate to Windows paths, but you can just run a Cygwin shell and access ~/.ssh/ from there.) – user1686 – 2016-05-23T13:21:31.727

mmm....I did as you said, for some reason it keeps asking me for the password. trying to access vice versa from the WINDOWS to the LINUX it doesn't ask me for any password. – Shachar Hamuzim Rajuan – 2016-05-23T13:57:59.180