Operating System - Linux
1752799 Members
5752 Online
108789 Solutions
New Discussion юеВ

Re: Can't ssh from windows to Linux with ssh keys in place

 
SOLVED
Go to solution

Can't ssh from windows to Linux with ssh keys in place


OpenSSH_3.7.1p1, SSH protocols 1.5/2.0, OpenSSL 0.9.7b 10 Apr 2003
debug1: Reading configuration data /etc/ssh_config
debug2: ssh_connect: needpriv 0
debug1: Connecting to 172.16.2.120 [172.16.2.120] port 22.
debug1: Connection established.
debug1: identity file /home/Administrator/.ssh/identity type -1
debug3: Not a RSA1 key file /home/Administrator/.ssh/id_rsa.
debug2: key_type_from_name: unknown key type '-----BEGIN'
debug3: key_read: missing keytype
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug2: key_type_from_name: unknown key type '-----END'
debug3: key_read: missing keytype
debug1: identity file /home/Administrator/.ssh/id_rsa type 1
debug1: identity file /home/Administrator/.ssh/id_dsa type -1
debug1: Remote protocol version 1.99, remote software version OpenSSH_3.4p1
debug1: match: OpenSSH_3.4p1 pat OpenSSH_3.2*,OpenSSH_3.3*,OpenSSH_3.4*,OpenSSH
3.5*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.7.1p1
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-gr
up1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour
aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-
tr
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour
aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-
tr
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@ope
ssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@ope
ssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib
debug2: kex_parse_kexinit: none,zlib
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: kex_parse_kexinit: diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: 3des-cbc
debug2: kex_parse_kexinit: 3des-cbc
debug2: kex_parse_kexinit: hmac-sha1,hmac-md5,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-sha1,hmac-md5,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none
debug2: kex_parse_kexinit: none
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: mac_init: found hmac-md5
debug1: kex: server->client 3des-cbc hmac-md5 none
debug2: mac_init: found hmac-md5
debug1: kex: client->server 3des-cbc hmac-md5 none
debug2: dh_gen_key: priv key bits set: 178/384
debug2: bits set: 492/1024
debug1: sending SSH2_MSG_KEXDH_INIT
debug1: expecting SSH2_MSG_KEXDH_REPLY
debug3: check_host_in_hostfile: filename /home/Administrator/.ssh/known_hosts
debug3: check_host_in_hostfile: match line 1
debug1: Host '172.16.2.120' is known and matches the RSA host key.
debug1: Found key in /home/Administrator/.ssh/known_hosts:1
debug2: bits set: 528/1024
debug1: ssh_rsa_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /home/Administrator/.ssh/identity (0x0)
debug2: key: /home/Administrator/.ssh/id_rsa (0x100fa368)
debug2: key: /home/Administrator/.ssh/id_dsa (0x0)
debug1: Authentications that can continue: publickey,password
debug3: start over, passed a different list publickey,password
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /home/Administrator/.ssh/identity
debug3: no such identity: /home/Administrator/.ssh/identity
debug1: Offering public key: /home/Administrator/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /home/Administrator/.ssh/id_dsa
debug3: no such identity: /home/Administrator/.ssh/id_dsa
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password

Any help would be appreciated.
Thanks,
Alex
7 REPLIES 7
Court Campbell
Honored Contributor

Re: Can't ssh from windows to Linux with ssh keys in place

can you explain the steps you took to set this up. and what ssh client are you using on the windows side?
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"

Re: Can't ssh from windows to Linux with ssh keys in place

I generated the key on windows:
ssh-keygen -t rsa

copied the key to the Linux box.

formatted the key and concatenated it to authorized_keys:

ssh-keygen -e -f id_rsa.sfvmvcs1 >> authorized_keys
Court Campbell
Honored Contributor
Solution

Re: Can't ssh from windows to Linux with ssh keys in place

I am assuming that the file id_rsa.sfvmvcs1 is your public key. If it isn't that could be a problem. ssh-keygen should have created a file called is_rsa.pub which would be the public file. Moving on, I really do not think that you needed to export the file to IETF SECSH. try just cat'ing your pub key to .ssh/authorized_keys.

You could also try just removing the lines

---- BEGIN SSH2 PUBLIC KEY ----
---- END SSH2 PUBLIC KEY ----
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"

Re: Can't ssh from windows to Linux with ssh keys in place

Yes, it is the public key.

The windows key on the Linux host looks something like this:

---- BEGIN SSH2 PUBLIC KEY ----
Comment: "1024-bit RSA, converted from OpenSSH "

thanks,
Alex
Court Campbell
Honored Contributor

Re: Can't ssh from windows to Linux with ssh keys in place

just remove the lines you added and just add the pub key as is.

cat id_rsa.sfvmvcs1 >> .ssh/authorized_keys
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"

Re: Can't ssh from windows to Linux with ssh keys in place

I didn't add any lines.

Re: Can't ssh from windows to Linux with ssh keys in place

Thanks .... at first I didn't know what you meant, but it's working now. I guess I was never supposed to reformat the key for Linux?