SSH Keys between RHEL 5 and Solaris 10

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat SSH Keys between RHEL 5 and Solaris 10
# 15  
Old 11-14-2011
Good call... do it... do it now... and don't pass "Go" until you've done it, ya hear me?!

PS: Good luck Smilie
# 16  
Old 11-14-2011
Code:
 chmod 700 $HOME/.ssh

# 17  
Old 11-21-2011
Apologies for late reply, I was away from work for a week.
I have trashed the user and recreated it on the RH box. Same result though.
@vgersh99, I have modified permissions as well.

I did it step by step as you did it, Scott. I'm going to keep playing around with this, I need to get it right.
# 18  
Old 01-18-2012
Ok so I've picked this up again after having to attend to more urgent matters. For testing purposes I set up two VM's on my laptop. One is running RHEL 6 and the other is running Solaris 10. Both for x86 platform.
I can successfully set up key pairs between the two VM's using the methods mentioned in this thread. (Log in without password from Redhat machine to the Solaris machine).
I then tried to set up a key pair between my Redhat VM and the Solaris server I'm actually trying to get it working on and it doesn't work. So that's two different versions of Redhat that doesn't work but it works from the Redhat VM to the Solaris (latest version 10 x86) VM.
I noticed that the ssh package versions are slightly different between the two Solaris instances. I can't however get that version because the server is running on the SPARC platform and already has the latest ssh package for version 10.
If there are any more ideas out there feel free to comment. Just putting it out there Smilie
# 19  
Old 01-18-2012
From the user who you're setting up passwordless, can you paste the output of:

Code:
ssh -vvv user@host

That'll tell us where it's going wrong.

My money's (but i've always been a rotten gambler!) on this idea:

Quote:
Originally Posted by vgersh99
Code:
 chmod 700 $HOME/.ssh

ssh checks perms on the files under ~/.ssh, e.g. if ~/.ssh/id_rsa is anything other than chmod 400 it rubber ear's the file :-)

To give you some hope - if i had £1 for every time i've set this up for production i wouldn't need to work anymore.

There can be loads of small bumps in the road with this - things like keon with dodgy LATs running on the remote host or business groups with policy's that mean AuthorizedKeysFile location is set elsewhere than ~/.ssh/authorized_keys on the remote host. Fun fun fun! :-)
# 20  
Old 01-19-2012
Hi craigp84

The output below:

Code:
ssh -vvv user@solarishost
OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to solarishost [xx.xx.xx.xx] port 22.
debug1: Connection established.
debug1: identity file /home/directory/.ssh/identity type -1
debug3: Not a RSA1 key file /home/directory/.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
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/directory/.ssh/id_rsa type 1
debug1: identity file /home/directory/.ssh/id_dsa type -1
debug1: loaded 3 keys
debug1: Remote protocol version 2.0, remote software version Sun_SSH_1.1.2
debug1: no match: Sun_SSH_1.1.2
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.3
debug2: fd 3 setting O_NONBLOCK
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit: none,zlib@openssh.com,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: gss-group1-sha1-toWM5Slw5Ew8Mqkay+al2g==,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-cbc,blowfish-cbc,3des-cbc
debug2: kex_parse_kexinit: aes128-cbc,blowfish-cbc,3des-cbc
debug2: kex_parse_kexinit: hmac-sha1,hmac-md5
debug2: kex_parse_kexinit: hmac-sha1,hmac-md5
debug2: kex_parse_kexinit: none,zlib
debug2: kex_parse_kexinit: none,zlib
debug2: kex_parse_kexinit: ar-EG,en-CA,es-MX,ar,en-US,es,fr,fr-CA,i-default
debug2: kex_parse_kexinit: ar-EG,en-CA,es-MX,ar,en-US,es,fr,fr-CA,i-default
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: mac_init: found hmac-md5
debug1: kex: server->client aes128-cbc hmac-md5 none
debug2: mac_init: found hmac-md5
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug2: dh_gen_key: priv key bits set: 120/256
debug2: bits set: 487/1024
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug3: check_host_in_hostfile: filename /home/directory/.ssh/known_hosts
debug3: check_host_in_hostfile: match line 1
debug3: check_host_in_hostfile: filename /home/directory/.ssh/known_hosts
debug3: check_host_in_hostfile: match line 1
debug1: Host 'solarishost' is known and matches the RSA host key.
debug1: Found key in /home/directory/.ssh/known_hosts:1
debug2: bits set: 537/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/directory/.ssh/identity ((nil))
debug2: key: /home/directory/.ssh/id_rsa (0x2af48ff753a0)
debug2: key: /home/directory/.ssh/id_dsa ((nil))
debug3: input_userauth_banner

xxxxxxxxxxxxxxxxxxxxxxx

debug1: Authentications that can continue: gssapi-keyex,gssapi-with-mic,publickey,password,keyboard-interactive
debug3: start over, passed a different list gssapi-keyex,gssapi-with-mic,publickey,password,keyboard-interactive
debug3: preferred gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_lookup gssapi-with-mic
debug3: remaining preferred: publickey,keyboard-interactive,password
debug3: authmethod_is_enabled gssapi-with-mic
debug1: Next authentication method: gssapi-with-mic
debug3: Trying to reverse map address xx.xx.xx.xx.
debug1: Unspecified GSS failure.  Minor code may provide more information
Unknown code krb5 195

debug1: Unspecified GSS failure.  Minor code may provide more information
Unknown code krb5 195

debug1: Unspecified GSS failure.  Minor code may provide more information
Unknown code krb5 195

debug2: we did not send a packet, disable method
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/directory/.ssh/identity
debug3: no such identity: /home/directory/.ssh/identity
debug1: Offering public key: /home/directory/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: gssapi-keyex,gssapi-with-mic,publickey,password,keyboard-interactive
debug1: Trying private key: /home/directory/.ssh/id_dsa
debug3: no such identity: /home/directory/.ssh/id_dsa
debug2: we did not send a packet, disable method
debug3: authmethod_lookup keyboard-interactive
debug3: remaining preferred: password
debug3: authmethod_is_enabled keyboard-interactive
debug1: Next authentication method: keyboard-interactive
debug2: userauth_kbdint
debug2: we sent a keyboard-interactive packet, wait for reply
debug2: input_userauth_info_req
debug2: input_userauth_info_req: num_prompts 1
Password:

# 21  
Old 01-19-2012
Code:
debug1: Offering public key: /home/directory/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: gssapi-keyex,gssapi-with-mic,publickey,password,keyboard-interactive

The .ssh/id_rsa didn't match the id_rsa.pub appended to the authorized_keys file on the far side.

The key on the near side appears to be ok (it complains if the key isn't in either OpenSSH or SECSH format).

So the issue isn't on the client, it's on the server. Noone's overridden the AuthorizedKeysFile location in /etc/ssh/sshd_config from the default ~/.ssh/aut...?

Luckily the sshd also support's this -vvv trick:

Code:
root$ sshd -D -vvv -p2222

This will launch a seperate sshd (so if you login to the server via ssh it wont affect your connection on port 22), it keeps the sshd in the foreground, with verbose output, listening on port 2222.

To connect from the client side:

Code:
client$ ssh -p2222 host

The output on the server side will clear up for us why it believes the keys don't match.
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find active SSH servers w/ ssh keys on LAN

Hi, I am trying to complete my bash script in order to find which SSH servers on LAN are still active with the ssh keys, but i am frozen at this step: #!/bin/bash # LAN SSH KEYS DISCOVERY SCRIPT </etc/passwd \ grep /bin/bash | cut -d: -f6 | sudo xargs -i -- sh -c ' && cat... (11 Replies)
Discussion started by: syrius
11 Replies

2. Solaris

help with SSH keys

Hello, I could use some help with my ssh keys and agent. This is the issue. I have 2 different UNIX systems at work. One is the normal Solaris servers with my uid being the same throughout all the servers. I now have a different system for my desktop. A contractor came in and installed some SUN... (0 Replies)
Discussion started by: bitlord
0 Replies

3. Red Hat

cannot ssh (use NFS) on RHEL box, but can mount external & ssh out of RHEL box

Ok, Im trying to get NFS working on my RHEL 5 box, apparently i can use the box as a client, but not as a server. If it helps i cant ssh into the box (server), but as a client ssh works fine. Ive configured server: /etc/hosts.allow: all : all all :all@all setup my /etc/exports file... (4 Replies)
Discussion started by: drs.grid
4 Replies

4. Shell Programming and Scripting

What are public keys in ssh and how do we create the public keys??

Hi All, I am having knowledge on some basics of ssh and wanted to know what are the public keys and how can we create and implement it in connecting server. Please provide the information for the above, it would be helpful for me. Thanks, Ravindra (1 Reply)
Discussion started by: ravi3cha
1 Replies

5. UNIX for Dummies Questions & Answers

ssh keys monitoring

Hi, I have ssh keys (id_rsa and id_rsa.pub). However, every once in a while, someone deletes these keys. here's what i want to do : 1. on my server, it will ssh user@password into the target machine(where ssh keys are located). 2. check the date/filesize of id_rsa, id_rsa.pub). 3.... (0 Replies)
Discussion started by: tungaw2004
0 Replies

6. UNIX for Dummies Questions & Answers

SSH keys

Hi everyone, i wanted to generate ssh keys so that i can include the public key in the remote sever, so that for subsequent logins, i can do away with the keying in of the password. I consulted the man ssh-keygen man pages. "..Normally each user wishing to use SSH with RSA or DSA... (1 Reply)
Discussion started by: new2ss
1 Replies

7. UNIX for Advanced & Expert Users

SSH Keys Help

Hello, I'm wondering if anyone has a step-by-step instruction set for setting up ssh keys? I've gone through many of the manuals online (most seem to be from the same source) and it's a little bit unclear when the documentation is talking about the server versus the client machine. I'm missing... (1 Reply)
Discussion started by: sysera
1 Replies
Login or Register to Ask a Question