New User? Register here - Existing Users: Username: Password: [Advanced Login]

 

 

Current Poll

Your preferred Interactive shell?









( 1391 votes ~ 15 comments )

 

Weblog entry #1 for sarthakjain

Problem with ssh using RSA authentication on Windo
Posted by sarthakjain on Wed 23 Jun 2010 at 12:48
Tags: none.
You cannot vote on your own post
0

I am working on a 64-bit windows 7 machine.

I have installed ssh on my machine through cygwin.

I am trying to connect an XP machine to this windows7 machine through SSH using RSA authentiation..I am proceeding as follows:

1. On the XP machine, I create an RSA public/private key pair using the command

ssh-keygen -t rsa

following 2 files get created at ~/.ssh/ location :

id_rsa and id_rsa.pub

2. Next I copy the id_rsa.pub file on my windows7 machine.

3. Then I append the contents of id_rsa.pub to the file ~/.ssh/authorized_keys on the windows7 machine.

cd ~/.ssh

cat id_rsa.pub >> authorized_keys

chmod 600 authorized_keys

chmod 755 ~/.ssh

4. I restart the sshd service on this machine

5. I try to ssh from the XP machine to the win7 machine.



I am observing the following output:

...

..

..

debug1: Offering public key: /home/Administrator/.ssh/id_rsa

debug2: We sent a public key packet, wait for reply

connection closed by xx.xx.xx.xx



Plz help!!!!!!!!!!!

 

Comments on this Entry

Posted by Anonymous (71.173.xx.xx) on Thu 24 Jun 2010 at 01:37
Hmmm, I didn't know that windows had a chmod command.

[ Parent | Reply to this comment ]

Posted by sarthakjain (125.18.xx.xx) on Thu 24 Jun 2010 at 06:10
[ Send Message | View Weblogs ]
I said that I installed ssh through cygwin.. cygwin porvides a linux-like environment on windows..So i am using the chmod and other commands on the cygwin prompt only..

[ Parent | Reply to this comment ]

Posted by Anonymous (129.206.xx.xx) on Mon 28 Jun 2010 at 16:13
Does it work using a password instead of public key authentification?

And maybe there is a windows firewall blocking all incoming packets?

[ Parent | Reply to this comment ]

Posted by Anonymous (125.18.xx.xx) on Tue 29 Jun 2010 at 06:12
Yes it is working fine when I use a password...its just when I copy the rsa key..it closes connection

I have allowed SSH connection on port 22 through the firewall..still I m facing the problem

[ Parent | Reply to this comment ]

Posted by ajt (195.112.xx.xx) on Mon 28 Jun 2010 at 22:05
[ Send Message | View Weblogs ]

I've got SSH working with Cygwin (POSIX environment not Linux) but it took a few goes to get it working. I can't remember exactly what I did but it was messy.

It helps to try and SSH into the box in verbose mode to see if you can see what is going on, and as others have said it is worth having a go with a password first before you use SSH keys.

--
"It's Not Magic, It's Work"
Adam

[ Parent | Reply to this comment ]

Posted by Anonymous (125.18.xx.xx) on Tue 29 Jun 2010 at 06:16
Yes it is working fine when I use a password...its just when I copy the rsa key..it closes connection

I have tried to run ssh in verbose mode..there only i found that the connection is established..then it says "Offering public key, wait for reply" and after this it says connection closed..

[ Parent | Reply to this comment ]

Posted by Anonymous (129.206.xx.xx) on Tue 29 Jun 2010 at 14:21


OK, next guess: on a typical linux installation, sshd requires that .ssh/ (and probably all files in this directory) are only owner-readable. I just had that issue yesterday...a simple 'chmod -R go-rwx .ssh/' cured a problem matching your description.
Maybe this is also true for a cygwin implementation...

[ Parent | Reply to this comment ]

Posted by Anonymous (125.18.xx.xx) on Wed 30 Jun 2010 at 07:30
did that also.. still facing the problem

[ Parent | Reply to this comment ]

Posted by Anonymous (82.144.xx.xx) on Wed 4 Aug 2010 at 12:01
I had this issue today with keys generated on Windows using Putty.
I don't know if it's the same for the windows command line but after much hair tearing I compared my authorized_keys file with that of the new user account I was creating.

In my file each line looked like:

ssh-rsa AAAAADDE4455........==

But the keys generated by Windows looked like:

--------------BEGIN SSH KEY-------------
AAAAAAFFF09.......{32}
{32}
...
...
...
------------- END ------------

or something similar.

I removed all the cruft around the actual key and put it all on one line as in my file, and it worked.

[ Parent | Reply to this comment ]

 

 

Flattr