ssh between cygwin and debian wheezy

0

I am trying to connect desktop(win7 x64) and note (debian wheezy x32). Made standard install of ssh cygwin and debian. Created pub-key and moved via usbflash it to ~/.ssh/authorizwd_keys and to ~/.ssh/

In cygwin made

cd ~/.ssh
chmod 700 id_rsa

Than try to connect and have a log

debug1: ssh_ecdsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/A/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Trying private key: /home/A/.ssh/id_dsa
debug1: Trying private key: /home/A/.ssh/id_ecdsa
debug1: Trying private key: /home/A/.ssh/id_ed25519
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: password

UPD Checked files permissions, Change LogLevel to DEBUG. Than I try to connect but nothing is written in log only info abot reloading service

May 17 09:48:44 a sshd[4337]: Received SIGHUP; restarting.
May 17 09:48:44 a sshd[4386]: Set /proc/self/oom_score_adj from -1000 to -1000
May 17 09:48:44 a sshd[4386]: debug1: Bind to port 22 on 0.0.0.0.
May 17 09:48:44 a sshd[4386]: Server listening on 0.0.0.0 port 22.
May 17 09:49:43 a sshd[4386]: Received SIGHUP; restarting.
May 17 09:49:43 a sshd[4417]: Set /proc/self/oom_score_adj from -1000 to -1000
May 17 09:49:43 a sshd[4417]: debug1: Bind to port 22 on 0.0.0.0.
May 17 09:49:43 a sshd[4417]: Server listening on 0.0.0.0 port 22.
May 17 09:49:43 a sshd[4417]: debug1: Bind to port 22 on ::.
May 17 09:49:43 a sshd[4417]: Server listening on :: port 22.
May 17 09:58:23 a sshd[4417]: Received SIGHUP; restarting.
May 17 09:58:23 a sshd[4491]: Server listening on 0.0.0.0 port 22.
May 17 09:58:23 a sshd[4491]: Server listening on :: port 22.

UPD tried to connect with command "ssh -vvv" in cygwin and saw strokes

"debug3 Incorrect RSA1 identifer" 
"debug3 Couldnt load "/home/A/.ssh/id_rsa" as RSA publick key"

user3003873

Posted 2014-05-16T17:01:45.427

Reputation: 101

For the future, notice that SSH has the ssh-copy-id program which takes care of properly adding your local public key to the list of authorized keys for your user on the target server. For it to work, another auth method has to work at the time you're using it -- such as keyboard-interactive. – kostix – 2014-05-16T17:49:01.267

Of course, I tried ssh-copy-id firstly - no result, so I did it handy. I need pnly keys, no pass interactive. – user3003873 – 2014-05-16T20:06:38.547

Answers

0

The client does not display messages like "failed to authenticate using method 'publickey' and the such-and-such key" so to propetly debug this problem follow this checklist on your Debian server:

  1. Make sure the permissions of the ~/.ssh directory of your user is not too permissive.

    It should typically be owned by user:user (where user is the name of your user on the server) and have 0700 permission bits set on it.

  2. Make sure the ~/.ssh/authorized_keys file is user:user and 0600.

  3. Edit /etc/ssh/sshd_config (notice the letter "d"—you need the server's configuration file) and raise its logging level:

    LogLevel DEBUG
    

    Save the file and reload the server's configuration:

    # service ssh reload
    
  4. Now perform another login attempt and inspect what sshd wrote to /var/log/auth.log.

  5. Restore the LogLevel setting to its standard value, INFO, and reload the configuration once again.

kostix

Posted 2014-05-16T17:01:45.427

Reputation: 2 435

I've done this. In question UPD there is log. But nothing changed even logging. – user3003873 – 2014-05-17T06:05:14.250

PS after new attempt it was created known_hosts file in servers ~/.ssh/ – user3003873 – 2014-05-17T06:19:28.523

UPDi tried to connect with command "ssh -vvv" in cygwin and saw strokes "debug3 Incorrect RSA1 identifer" and "debug3 Couldnt load "/home/A/.ssh/id_rsa" as RSA publick key" – user3003873 – 2014-05-17T06:27:37.327

@user3003873, it looks you've got a malformed private key. Try doing ssh-keygen -f /path/to/id_rsa -y to verify the key is OK (this command derives and prints the public key from the specified private key). – kostix – 2014-05-17T21:06:32.600

@user3003873, one more question: are you sure you have an RSA key, and not DSA? What options did you use to generate the key? – kostix – 2014-05-17T21:07:24.423

ssh-keygen -t rsa - I am sure because didnt change namee of key - and default if_rsa is by RSA. Sure? – user3003873 – 2014-05-18T03:24:43.090

@user3003873, what's with my first comment? Did you verify the key's integrity? I'm not sure about the default because I don't know if this default is built-in (in OpenSSH) or selected at build time or can be configured on a particular system. On Debian, it seems to be RSA. – kostix – 2014-05-18T08:00:24.400

Yes, I rechecked and it was realy something wrong with keys, but now corrected that, but with the same result. Also, tried to shh to localhost on win7 and deb it works, and on deb it put smth in auth.log, but when I try to connect from win7 to deb, nothing is written in log. – user3003873 – 2014-05-18T10:48:54.213