The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   Networking (http://hintsforums.macworld.com/forumdisplay.php?f=14)
-   -   need help with an SSH problem (http://hintsforums.macworld.com/showthread.php?t=23917)

kerplunk 05-17-2004 05:15 PM

need help with an SSH problem
 
Hi:

I'm trying to set up an SSH connection on my local network. I've generated DSA key pairs for all machines concerned, and distributed the public keys, but I can't seem to get a connection going correctly.

When I try to connect ssh me@blah.blah.blah I get this message:

The authenticity of host 'blah' can't be established.
RSA1 key fingerprint is blah.


and I get this line in the console:

service ssh, IPV6_ADDRFORM setsockopt() failed: Protocol not available (errno = 42)

Now I've seen some discussions about this message, but not quite in this same context. Anybody know why it is I can't get this thing going?

trevor 05-17-2004 09:19 PM

What version of OpenSSH are you running on the client and what version on the server? Or are you running something other than OpenSSH? If so, exactly what?

Trevor

kerplunk 05-17-2004 11:11 PM

both machines are running the 3.6.1 version on 10.3.3, and I'm not running anything additional that might interfere with SSH other than possibly Brickhouse.

trevor 05-17-2004 11:32 PM

Can you give us the line from /etc/ssh_config on the client machine and /etc/sshd_config on the server machine that refers to Protocol? For example, it may be something like:

Client: ssh_config
# Protocol 2,1

Server: sshd_config
Protocol 2

The above would indicate that your client is using default settings (it has the # preceding the line, which anyhow allows both ssh protocols 1 and 2) while the server only allows ssh protocol 2.

If you have something like:
Client: ssh_config
Protocol 1

Server: sshd_config
Protocol 2

...then we've found the problem.

Trevor

trevor 05-17-2004 11:35 PM

Another thing I'm wondering about is the part of the error message you mentioned:
Quote:

IPV6_ADDRFORM
Are you using IPV6 IP addresses? What unusual setup do you have in regards to IPV6?

Trevor

kerplunk 05-18-2004 08:35 AM

In answer to your first question, the only change to the default setup for SSH I have made is to disallow root login in sshd_config:

PermitRootLogin no

I haven't made any changes to ssh_config so the protocol specification is still commented out as:

# Protocol 2,1

Regarding IPV6, I haven't done anything with this. It's all still on auto pilot.

Thanks for your help.

Craig R. Arko 05-18-2004 09:01 AM

Just for the heck of it; go into the Network prefpane and disable IPv6 for the interface you're using (probably builtin ethernet). See if that helps.

kerplunk 05-18-2004 11:55 AM

No dice. Tried IPv6 off on both client and server, but the server still reports service ssh, IPV6_ADDRFORM setsockopt() failed: Protocol not available (errno = 42)

and ssh still reports The authenticity of host 'blah' can't be established. RSA1 key fingerprint is blah.


Why do you suppose it is trying to do RSA verification when I have explicity requested DSA verification?

ssh -2 me@blah.blah.blah

kerplunk 05-18-2004 07:06 PM

Here is the beginning of the debug output from SSH:

debug1: Rhosts Authentication disabled, originating port will not be trusted.
debug2: ssh_connect: needpriv 0
debug1: Connecting to xxx.xxx.xxx.xxx [xxx.xxx.xxx.xxx] port 22.
debug1: Connection established.
debug3: Not a RSA1 key file /Users/JDR/.ssh/id_rsa.
debug2: key_type_from_name: unknown key type '-----BEGIN'
debug3: key_read: missing keytype
debug2: key_type_from_name: unknown key type 'Proc-Type:'
debug3: key_read: missing keytype
debug2: key_type_from_name: unknown key type 'DEK-Info:'
debug3: key_read: missing keytype
debug3: key_read: missing whitespace


So it seems that SSH is not happy with the private key. Why, I can't begin to guess. In the second place, why does it keep trying to use RSA authentication when I have explicity told it to always DSA and never use RSA?

stetner 05-19-2004 12:34 AM

To get rid of the IPv6 stuff edit your file:

/etc/xinetd.d/ssh

and change:

flags = REUSE IPv6

To:

flags = REUSE IPv4

I will also help to get rid of the
Code:

reverse mapping checking getaddrinfo for xxxx.xxxx.edu.au failed - POSSIBLE BREAKIN ATTEMPT!
lines if you are getting them.

stetner 05-19-2004 12:38 AM

Quote:

Originally Posted by kerplunk
Here is the beginning of the debug output from SSH:

debug1: Rhosts Authentication disabled, originating port will not be trusted.
debug2: ssh_connect: needpriv 0
debug1: Connecting to xxx.xxx.xxx.xxx [xxx.xxx.xxx.xxx] port 22.
debug1: Connection established.
debug3: Not a RSA1 key file /Users/JDR/.ssh/id_rsa.
debug2: key_type_from_name: unknown key type '-----BEGIN'
debug3: key_read: missing keytype
debug2: key_type_from_name: unknown key type 'Proc-Type:'
debug3: key_read: missing keytype
debug2: key_type_from_name: unknown key type 'DEK-Info:'
debug3: key_read: missing keytype
debug3: key_read: missing whitespace


So it seems that SSH is not happy with the private key. Why, I can't begin to guess. In the second place, why does it keep trying to use RSA authentication when I have explicity told it to always DSA and never use RSA?

Nothing is worse than reading someone's posted log only to find when it gets to the interesting par

stetner 05-19-2004 12:42 AM

t it gets cut off! :)

post all the output.

Here is a successful connection:
Code:

$ cat zaqqaz
$ ssh -vvv xxxxxxx@xxxxxxx.org
OpenSSH_3.6.1p1+CAN-2003-0693, SSH protocols 1.5/2.0, OpenSSL 0x0090702f
debug1: Reading configuration data /etc/ssh_config
debug1: Rhosts Authentication disabled, originating port will not be trusted.
debug2: ssh_connect: needpriv 0
debug1: Connecting to xxxxxxx.org [xxx.xxx.xxx.xx] port 22.
debug1: Connection established.
debug1: identity file /Users/dgs/.ssh/identity type -1
debug1: identity file /Users/dgs/.ssh/id_rsa type -1
debug3: Not a RSA1 key file /Users/dgs/.ssh/id_dsa.
debug2: key_type_from_name: unknown key type '-----BEGIN'
debug3: key_read: missing keytype
debug2: key_type_from_name: unknown key type 'Proc-Type:'
debug3: key_read: missing keytype
debug2: key_type_from_name: unknown key type 'DEK-Info:'
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
debug2: key_type_from_name: unknown key type '-----END'
debug3: key_read: missing keytype
debug1: identity file /Users/dgs/.ssh/id_dsa type 2
debug1: Remote protocol version 1.99, remote software version OpenSSH_3.6.1p1+CAN-2003-0693
debug1: match: OpenSSH_3.6.1p1+CAN-2003-0693 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.6.1p1+CAN-2003-0693
debug3: Trying to reverse map address xxx.xxx.xxx.xx.
debug1: Miscellaneous failure
No credentials cache found

debug1: Miscellaneous failure
No credentials cache found

debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: diffie-hellman-group-exchange-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,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se
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
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-group-exchange-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,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se
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
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: 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 sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug2: dh_gen_key: priv key bits set: 118/256
debug2: bits set: 1564/3191
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug3: check_host_in_hostfile: filename /Users/dgs/.ssh/known_hosts
debug3: check_host_in_hostfile: match line 24
debug3: check_host_in_hostfile: filename /Users/dgs/.ssh/known_hosts
debug3: check_host_in_hostfile: match line 23
debug1: Host 'xxxxxxx.org' is known and matches the RSA host key.
debug1: Found key in /Users/dgs/.ssh/known_hosts:24
debug2: bits set: 1545/3191
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
debug1: Authentications that can continue: gssapi,publickey,keyboard-interactive
debug3: start over, passed a different list gssapi,publickey,keyboard-interactive
debug3: preferred external-keyx,gssapi,publickey,keyboard-interactive,password
debug3: authmethod_lookup gssapi
debug3: remaining preferred: publickey,keyboard-interactive,password
debug3: authmethod_is_enabled gssapi
debug1: Next authentication method: gssapi
debug2: we sent a gssapi packet, wait for reply
debug1: Server GSSAPI Error:
An invalid name was supplied
Configuration file does not specify default realm


debug1: Authentications that can continue: gssapi,publickey,keyboard-interactive
debug2: we sent a gssapi packet, wait for reply
debug1: Authentications that can continue: gssapi,publickey,keyboard-interactive
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: Offering agent key: /Users/dgs/.ssh/id_dsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Server accepts key: pkalg ssh-dss blen 434 lastkey 0x3214a0 hint -1
debug2: input_userauth_pk_ok: fp 7f:7a:7e:04:aa:53:55:88:08:9f:0f:fd:f5:f1:df:38
debug3: sign_and_send_pubkey
debug3: clear_auth_state: key_free 0x3214a0
debug1: Authentication succeeded (publickey).
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug1: Entering interactive session.
debug2: callback start
debug2: ssh_session2_setup: id 0
debug1: channel 0: request pty-req
debug3: tty_make_modes: ospeed 9600
debug3: tty_make_modes: ispeed 9600
debug3: tty_make_modes: 1 3
debug3: tty_make_modes: 2 28
debug3: tty_make_modes: 3 127
debug3: tty_make_modes: 4 21
debug3: tty_make_modes: 5 4
debug3: tty_make_modes: 6 255
debug3: tty_make_modes: 7 255
debug3: tty_make_modes: 8 17
debug3: tty_make_modes: 9 19
debug3: tty_make_modes: 10 26
debug3: tty_make_modes: 11 25
debug3: tty_make_modes: 12 18
debug3: tty_make_modes: 13 23
debug3: tty_make_modes: 14 22
debug3: tty_make_modes: 17 255
debug3: tty_make_modes: 18 15
debug3: tty_make_modes: 30 0
debug3: tty_make_modes: 31 0
debug3: tty_make_modes: 32 0
debug3: tty_make_modes: 33 0
debug3: tty_make_modes: 34 0
debug3: tty_make_modes: 35 0
debug3: tty_make_modes: 36 1
debug3: tty_make_modes: 38 1
debug3: tty_make_modes: 39 1
debug3: tty_make_modes: 40 0
debug3: tty_make_modes: 41 1
debug3: tty_make_modes: 50 1
debug3: tty_make_modes: 51 1
debug3: tty_make_modes: 53 1
debug3: tty_make_modes: 54 1
debug3: tty_make_modes: 55 0
debug3: tty_make_modes: 56 0
debug3: tty_make_modes: 57 0
debug3: tty_make_modes: 58 0
debug3: tty_make_modes: 59 1
debug3: tty_make_modes: 60 1
debug3: tty_make_modes: 61 1
debug3: tty_make_modes: 62 1
debug3: tty_make_modes: 70 1
debug3: tty_make_modes: 72 1
debug3: tty_make_modes: 90 1
debug3: tty_make_modes: 91 1
debug3: tty_make_modes: 92 0
debug3: tty_make_modes: 93 0
debug1: channel 0: request shell
debug2: callback done
debug1: channel 0: open confirm rwindow 0 rmax 32768
debug2: channel 0: rcvd adjust 131072
Last login: Wed May 19 14:35:37 2004 from xxxxxx.xxxxx.uq
Welcome to Darwin!

HOME 14:35:51 ~
xxxxxxx@strider 503 $


nkuvu 05-19-2004 01:34 AM

Quote:

Originally Posted by stetner
Nothing is worse than reading someone's posted log only to find when it gets to the interesting par

I think many people are (properly) concerned about flooding the boards with their log files. Of course on this forum, using the code tags like you did in your next post makes a nice text window with scroll bars...

Eh, don't mind me, I'm just rambling.

stetner 05-19-2004 01:52 AM

I suppose I did not really say what I wanted to point out...

Even with a good connection, there are parts of the debug output that look like failures. Therefore you cannot really tell what is going on without seeing all the data (including the command that is used to produce the output).

Maybe '-vvv' is a bit of over kill, I suppose he could start with '-v' or '-vv' and see if we need more....

kerplunk 05-19-2004 11:10 AM

Here's the whole log, after making changes to SSH:

Code:

debug1: Rhosts Authentication disabled, originating port will not be trusted.
debug2: ssh_connect: needpriv 0
debug1: Connecting to xxx[xxx] port 22.
debug1: Connection established.
debug3: Not a RSA1 key file /Users/JDR/.ssh/id_rsa.
debug2: key_type_from_name: unknown key type '-----BEGIN'
debug3: key_read: missing keytype
debug2: key_type_from_name: unknown key type 'Proc-Type:'
debug3: key_read: missing keytype
debug2: key_type_from_name: unknown key type 'DEK-Info:'
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 /Users/JDR/.ssh/id_rsa type 1
debug3: Not a RSA1 key file /Users/JDR/.ssh/id_dsa.
debug2: key_type_from_name: unknown key type '-----BEGIN'
debug3: key_read: missing keytype
debug2: key_type_from_name: unknown key type 'Proc-Type:'
debug3: key_read: missing keytype
debug2: key_type_from_name: unknown key type 'DEK-Info:'
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
debug2: key_type_from_name: unknown key type '-----END'
debug3: key_read: missing keytype
debug1: identity file /Users/JDR/.ssh/id_dsa type 2
debug1: Remote protocol version 2.0, remote software version OpenSSH_3.6.1p1+CAN-2003-0693
debug1: match: OpenSSH_3.6.1p1+CAN-2003-0693 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.6.1p1+CAN-2003-0693
debug3: Trying to reverse map address xxx
debug1: An invalid name was supplied
Cannot determine realm for numeric host address

debug1: An invalid name was supplied
A parameter was malformed
Validation error

debug1: An invalid name was supplied
Cannot determine realm for numeric host address

debug1: An invalid name was supplied
A parameter was malformed
Validation error

debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-dss
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se
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
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-group-exchange-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,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se
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
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: 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 sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug2: dh_gen_key: priv key bits set: 139/256
debug2: bits set: 1611/3191
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug3: check_host_in_hostfile: filename /Users/JDR/.ssh/known_hosts
debug3: check_host_in_hostfile: filename /etc/ssh_known_hosts
debug3: check_host_in_hostfile: filename /Users/JDR/.ssh/known_hosts
debug3: check_host_in_hostfile: filename /etc/ssh_known_hosts
debug2: no key of type 0 for host 192.168.254.197
debug3: check_host_in_hostfile: filename /Users/JDR/.ssh/known_hosts2
debug3: check_host_in_hostfile: filename /etc/ssh_known_hosts2
debug3: check_host_in_hostfile: filename /Users/JDR/.ssh/known_hosts
debug3: check_host_in_hostfile: filename /etc/ssh_known_hosts
debug2: no key of type 1 for host xxx
The authenticity of host 'xxx (xxx)' can't be established.
DSA key fingerprint is xxx.


stetner 05-19-2004 06:47 PM

Quote:

Originally Posted by kerplunk
Code:

debug3: check_host_in_hostfile: filename /Users/JDR/.ssh/known_hosts
debug3: check_host_in_hostfile: filename /etc/ssh_known_hosts
debug3: check_host_in_hostfile: filename /Users/JDR/.ssh/known_hosts
debug3: check_host_in_hostfile: filename /etc/ssh_known_hosts
debug2: no key of type 0 for host 192.168.254.197
debug3: check_host_in_hostfile: filename /Users/JDR/.ssh/known_hosts2
debug3: check_host_in_hostfile: filename /etc/ssh_known_hosts2
debug3: check_host_in_hostfile: filename /Users/JDR/.ssh/known_hosts
debug3: check_host_in_hostfile: filename /etc/ssh_known_hosts
debug2: no key of type 1 for host xxx
The authenticity of host 'xxx (xxx)' can't be established.
DSA key fingerprint is xxx.


Ok, it looks like your remote host is not being found in the .ssh/known_hosts file on your originating machine.

If, on the originating machine, you do a
Code:

grep 192.168.254.197 ~/.ssh/known*
does it find a key? I don't think it will.

You might want to google for 'set up ssh keys' which will provide many hits for setting up your keys correctly.

kerplunk 05-19-2004 09:01 PM

I have set up each machine so that it has all the public keys of the others. My understanding of known_hosts is that addresses are written to it by SSH, and after keys have been resolved and the connection made. Is this incorrect?

stetner 05-19-2004 10:20 PM

Darn, I was sure I submitted a reply to this a few minutes ago, but I guess I screwed up the post.... Anyway, it went something like:

D'oh, right you are.

What does:
Code:

$ ls -l /etc/ssh*
-rw-r--r--  1 root  wheel  1144 31 Oct  2003 /etc/ssh_config
-rw-------  1 root  wheel  668 29 Oct  2003 /etc/ssh_host_dsa_key
-rw-r--r--  1 root  wheel  590 29 Oct  2003 /etc/ssh_host_dsa_key.pub
-rw-------  1 root  wheel  515 29 Oct  2003 /etc/ssh_host_key
-rw-r--r--  1 root  wheel  319 29 Oct  2003 /etc/ssh_host_key.pub
-rw-------  1 root  wheel  887 29 Oct  2003 /etc/ssh_host_rsa_key
-rw-r--r--  1 root  wheel  210 29 Oct  2003 /etc/ssh_host_rsa_key.pub
-rw-r--r--  1 root  wheel  2453  2 Mar 16:14 /etc/sshd_config

show on your client and server?

As well, on the client,
Code:

$ ls -l .ssh
total 48
drwx------    6 stetner  stetner  272 17 Jan 14:21 ./
drwxr-xr-x  119 stetner  stetner  4046 20 May 09:41 ../
-rw-r-----    1 stetner  stetner  3656 24 Jan 10:27 authorized_keys2
-rw-------    1 stetner  stetner  744  2 Nov  2003 id_dsa
-rw-r-----    1 stetner  stetner  605  2 Nov  2003 id_dsa.pub
-rw-r--r--    1 stetner  stetner  1592 14 Feb 08:52 known_hosts

PS. splitting headache today, so take what I say with that in mind.... :(

kerplunk 05-20-2004 09:17 AM

Don't worry, it's probably not a tumor... :D

Server:

Code:

Mutsu:~ JDR$ ls -l /etc/ssh*
-rw-r--r--  1 root  wheel  1144 25 Sep  2003 /etc/ssh_config
-rw-------  1 root  wheel  668 14 May 08:59 /etc/ssh_host_dsa_key
-rw-r--r--  1 root  wheel  590 14 May 08:59 /etc/ssh_host_dsa_key.pub
-rw-------  1 root  wheel  515 14 May 08:59 /etc/ssh_host_key
-rw-r--r--  1 root  wheel  319 14 May 08:59 /etc/ssh_host_key.pub
-rw-------  1 root  wheel  887 14 May 08:59 /etc/ssh_host_rsa_key
-rw-r--r--  1 root  wheel  210 14 May 08:59 /etc/ssh_host_rsa_key.pub
-rw-r--r--  1 root  wheel  605 14 May 09:43 /etc/ssh_known_hosts
-rw-r--r--  1 root  wheel  2435 18 May 17:21 /etc/sshd_config

Mutsu:~/.ssh JDR$ ls -l
total 48
-rw-r--r--  1 JDR  JDR  605 17 May 14:48 authorized_keys
-rw-------  1 JDR  JDR  1229 18 May 17:20 config
-rw-------  1 JDR  JDR  736 17 May 12:04 id_dsa
-rw-r--r--  1 JDR  JDR  605 17 May 12:04 id_dsa.pub
-rw-------  1 JDR  JDR  951 17 May 15:01 id_rsa
-rw-r--r--  1 JDR  JDR  225 17 May 15:01 id_rsa.pub


Client:

Code:

Akane:~ JDR$ ls -l /etc/ssh*
-rw-r--r--  1 root  wheel  1144 18 May 16:43 /etc/ssh_config
-rw-------  1 root  wheel  668 18 May 10:26 /etc/ssh_host_dsa_key
-rw-r--r--  1 root  wheel  590 18 May 10:26 /etc/ssh_host_dsa_key.pub
-rw-------  1 root  wheel  515 18 May 10:26 /etc/ssh_host_key
-rw-r--r--  1 root  wheel  319 18 May 10:26 /etc/ssh_host_key.pub
-rw-------  1 root  wheel  883 18 May 10:26 /etc/ssh_host_rsa_key
-rw-r--r--  1 root  wheel  210 18 May 10:26 /etc/ssh_host_rsa_key.pub
-rw-r--r--  1 root  wheel    0 18 May 16:07 /etc/ssh_known_hosts
-rw-r--r--  1 root  wheel  2462 18 May 17:14 /etc/sshd_config


Akane:~/.ssh JDR$ ls -l
total 40
-rw-r--r--  1 JDR  JDR  225 17 May 15:01 authorized_keys
-rw-------  1 JDR  JDR  1227 18 May 17:24 config
-rw-------  1 JDR  JDR  744 17 May 14:48 id_dsa
-rw-r--r--  1 JDR  JDR  605 17 May 14:48 id_dsa.pub


stetner 05-21-2004 01:02 AM

Have you tried putting the public keys in the file

authorized_keys2

rather than the file

authorized_keys

?

kerplunk 05-21-2004 12:57 PM

No joy.

Ok, here is a detailed description of the conditions. I have tried to set things up to emliminate any extraneous influences.

CONDITIONS:
- server and client are now directly connected by CAT5 and have manually specified addresses.
- no firewall on either end
- remote login is started
Code:

May 21 11:00:17 Mutsu xinetd[1001]: xinetd Version 2.3.11 started with libwrap options compiled in.
May 21 11:00:17 Mutsu xinetd[1001]: Started working: 1 available service

- can ping both sides, client can see that server port 22 is open and listening


CONFIGURATION FILES (these are the same on both client and server):
- /etc/sshd_config:
Code:

#Port 22
#Protocol 2,1
Protocol 2
#ListenAddress 0.0.0.0
#ListenAddress ::

# HostKey for protocol version 1
#HostKey /etc/ssh_host_key
# HostKeys for protocol version 2
#HostKey /etc/ssh_host_rsa_key
#HostKey /etc/ssh_host_dsa_key

# Lifetime and size of ephemeral version 1 server key
#KeyRegenerationInterval 3600
#ServerKeyBits 768

# Logging
#obsoletes QuietMode and FascistLogging
#SyslogFacility AUTH
#LogLevel INFO
LogLevel DEBUG3

# Authentication:

#LoginGraceTime 120
PermitRootLogin no
#StrictModes yes

#RSAAuthentication yes
#PubkeyAuthentication yes
#AuthorizedKeysFile    .ssh/authorized_keys

# rhosts authentication should not be used
#RhostsAuthentication no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
#RhostsRSAAuthentication no
# similar for protocol version 2
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and HostbasedAuthentication
#IgnoreUserKnownHosts no

# To disable tunneled clear text passwords, change to no here!
#PasswordAuthentication yes
#PermitEmptyPasswords no

# Change to no to disable s/key passwords
#ChallengeResponseAuthentication yes

# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes

#AFSTokenPassing no

# Kerberos TGT Passing only works with the AFS kaserver
#KerberosTgtPassing no

# Set this to 'yes' to enable PAM keyboard-interactive authentication
# Warning: enabling this may bypass the setting of 'PasswordAuthentication'
#PAMAuthenticationViaKbdInt no

#X11Forwarding no
#X11DisplayOffset 10
#X11UseLocalhost yes
#PrintMotd yes
#PrintLastLog yes
#KeepAlive yes
#UseLogin no
#UsePrivilegeSeparation yes
#PermitUserEnvironment no
#Compression yes

#MaxStartups 10
# no default banner path
#Banner /some/path
VerifyReverseMapping yes

# override default of no subsystems
Subsystem      sftp    /usr/libexec/sftp-server

- My changes from the stock sshd_config are:
1) set "Protocol 2"
2) set "LogLevel DEBUG3"
3) set "PermitRootLogin no"

- ~/.ssh/config:
Code:

# Host *
#  ForwardAgent no
#  ForwardX11 no
#  RhostsAuthentication no
#  RhostsRSAAuthentication no
#  RSAAuthentication yes
RSAAuthentication no
#  PasswordAuthentication yes
#  HostbasedAuthentication no
#  BatchMode no
#  CheckHostIP yes
#  StrictHostKeyChecking ask
#  IdentityFile ~/.ssh/identity
#  IdentityFile ~/.ssh/id_rsa
#  IdentityFile ~/.ssh/id_dsa
#  Port 22
#  Protocol 2,1
Protocol 2
#  Cipher 3des
#  Ciphers aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc
#  EscapeChar ~

HostKeyAlgorithms ssh-dss
LogLevel DEBUG3
User JDR

- There is some redundancy here, but my changes from the stock sshd_config are:
1) set "RSAAuthentication no"
2) set "Protocol 2"
3) set "HostKeyAlgorithms ssh-dss"
4) set "LogLevel DEBUG3"
5) set "User JDR"

SETUP AND EXECUTION:
1) Generate keys on server and client "ssh-keygen -t dsa"
2) Exchange public keys where each public key becomes "~/.ssh/authorized_keys" and also (for good measure) "~/.ssh/authorized_keys2"
3) Idiot check that there are not line feeds in these files
4) try the connection "ssh 192.168.0.9" or "ssh -l JDR 192.168.0.9" OR "ssh JDR@192.168.09"
5) piss and moan

I won't inlcude again the client reponse, but here is what is logged on the server:
Code:

May 21 11:13:51 Mutsu xinetd[1001]: START: ssh pid=1156 from=192.168.0.8
May 21 11:13:51 Mutsu sshd[1156]: Connection from 192.168.0.8 port 49310


stetner 05-21-2004 07:05 PM

Well, I just replaced my ssh_config and my sshd_config with yours on both my Uni and home machine, and I can still connect with no problems.... I do get this
Code:

debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug3: check_host_in_hostfile: filename /Users/dgs/.ssh/known_hosts
debug3: key_read: type mismatch
debug3: check_host_in_hostfile: filename /etc/ssh_known_hosts
debug3: check_host_in_hostfile: filename /Users/dgs/.ssh/known_hosts
debug3: key_read: type mismatch
debug3: check_host_in_hostfile: filename /etc/ssh_known_hosts
debug3: check_host_in_hostfile: filename /Users/dgs/.ssh/known_hosts
debug3: check_host_in_hostfile: filename /etc/ssh_known_hosts
debug2: no key of type 0 for host stetner.org
debug3: check_host_in_hostfile: filename /Users/dgs/.ssh/known_hosts2
debug3: check_host_in_hostfile: filename /etc/ssh_known_hosts2
debug3: check_host_in_hostfile: filename /Users/dgs/.ssh/known_hosts
WARNING: RSA key found for host stetner.org
in /Users/dgs/.ssh/known_hosts:24
RSA key fingerprint 8e:a8:ec:f8:1d:8a:20:39:f6:d1:36:70:e1:0f:90:02.
The authenticity of host 'stetner.org (xxx.xxx.xxx.xx)' can't be established,
but keys of different type are already known for this host.
DSA key fingerprint is 75:f6:71:8b:bd:f0:c4:a5:97:e7:db:b1:f4:e1:bb:2d.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'xxxxxxx.org,xxx.xxx.xxx.xx' (DSA) to the list of known hosts.
debug2: bits set: 1580/3191
debug1: ssh_dss_verify: signature correct

and my ~/.ssh/known_hosts is updated with a DSA key. So it is using DSA and still working. This is using 'ssh myuser@myhost.org' As the User entry in the ssh_config file trys to log in as JDR. Note the User keyword does not seem to be valid in sshd_config, at least I could not find it in the man page.

So, it does not seem to be your '_config' files. A long shot, and one I don't expect it to be, but you username is all uppercase. have you tried with a user with lowercase name? In fact, what you may want to do is to create a generic user on both machines, set all config files back to standard, set up keys and try to get it to work then. If it works, then slowly add one change at a time until it breaks. If it doesn't, then we will see where that leads us.

bluehz 06-11-2004 10:26 AM

I am still having serious issues logging into my Linux box after upgrading to 10.3.4. I have been admin this headless Linux box for over 2 years from the OS X box via SSH with no problems whatsoever. After updating to 10.3.4 - I can no longer login to the Linux box. Nothing has changed on the Linux box either.

I can verify that port 22 is still available on the Linux box, and I have tried deleting keys from the the OS X box as well as the whole .ssh dirs - stil no luck. Here is a typical session - hope someone can offer some advice... I'm stuck!

Code:

XXXX% ssh -vvv root@linux
OpenSSH_3.6.1p1+CAN-2003-0693, SSH protocols 1.5/2.0, OpenSSL 0x0090702f
debug1: Reading configuration data /etc/ssh_config
debug1: Rhosts Authentication disabled, originating port will not be trusted.
debug2: ssh_connect: needpriv 0
debug1: Connecting to linux [192.168.1.130] port 22.
debug1: Connection established.
debug1: identity file /Users/XXXX/.ssh/identity type -1
debug1: identity file /Users/XXXX/.ssh/id_rsa type -1
debug1: identity file /Users/XXXX/.ssh/id_dsa type -1
debug1: Remote protocol version 1.99, remote software version OpenSSH_3.7.1p2
debug1: match: OpenSSH_3.7.1p2 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.6.1p1+CAN-2003-0693
debug3: Trying to reverse map address 192.168.1.130.
debug1: Miscellaneous failure
No credentials cache found

debug1: Miscellaneous failure
No credentials cache found

debug1: SSH2_MSG_KEXINIT sent
Connection closed by 192.168.1.130
debug1: Calling cleanup 0x1c440(0x0)
[g4:~/.ssh] XXXX% ssh -vvv root@192.168.1.130
OpenSSH_3.6.1p1+CAN-2003-0693, SSH protocols 1.5/2.0, OpenSSL 0x0090702f
debug1: Reading configuration data /etc/ssh_config
debug1: Rhosts Authentication disabled, originating port will not be trusted.
debug2: ssh_connect: needpriv 0
debug1: Connecting to 192.168.1.130 [192.168.1.130] port 22.
debug1: Connection established.
debug1: identity file /Users/XXXX/.ssh/identity type -1
debug1: identity file /Users/XXXX/.ssh/id_rsa type -1
debug1: identity file /Users/XXXX/.ssh/id_dsa type -1
debug1: Remote protocol version 1.99, remote software version OpenSSH_3.7.1p2
debug1: match: OpenSSH_3.7.1p2 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.6.1p1+CAN-2003-0693
debug3: Trying to reverse map address 192.168.1.130.
debug1: Miscellaneous failure
No credentials cache found

debug1: Miscellaneous failure
No credentials cache found

debug1: SSH2_MSG_KEXINIT sent
Connection closed by 192.168.1.130
debug1: Calling cleanup 0x1c440(0x0)


stetner 06-12-2004 07:04 AM

Quote:

Originally Posted by bluehz
Code:

...
debug1: SSH2_MSG_KEXINIT sent
Connection closed by 192.168.1.130
debug1: Calling cleanup 0x1c440(0x0)


Are you sure the sshd on the remote host is not dying? I would start it up in debug mode and see what it is doing when the SSH2_MSG_KEXINIT is received.

bluehz 06-12-2004 10:10 AM

Yes I am sure the sshd isn't dying on the remote server. This is on a very stable production server that has been rock solid with ssh for the last 2 years. Only after the latest Security Update/10.3.4 update have I been unable to access it.

Quote:

Originally Posted by stetner
Are you sure the sshd on the remote host is not dying? I would start it up in debug mode and see what it is doing when the SSH2_MSG_KEXINIT is received.


davidduff 06-16-2004 03:41 PM

i am seeing the problem too. two weeks ago, i was able to access an ssh server. now (after the recent security update), i am not. running ssh with -v option, i see what look to be a lot of the same error messages "an invalid name was supplied", "configuration file does not specify a default realm", etc.

anyway, i just wanted to confirm that it appears that something broke due to the security update. i can still access some hosts normally. just one host is broken. i'm not sure how to fix it.

stetner 06-16-2004 08:49 PM

davidduff,

Is your remote server at this version as well?
Code:

debug1: Remote protocol version 1.99, remote software version OpenSSH_3.7.1p2
Maybe it is an incompatibility between versions...

From bluehz
Code:

...
debug1: SSH2_MSG_KEXINIT sent
Connection closed by 192.168.1.130
debug1: Calling cleanup 0x1c440(0x0)

This sure looks like the remote server is shutting down the connection... Maybe a verbose dump of what the sshd is doing may shed some light...

bluehz 06-17-2004 06:43 AM

I finally solved my problem after a lot of log watching, debugging on the server. Seems the server was looking for a dir named /var/empty and this dir did not exist. Why the server all of the sudden required this dir is beyond me. I have not modified the server or deleted anything in over 3-4 weeks, and the problem just started last week.

Anyway - as soon as I created a /var/empty - I was able to login again from 10.3.4.

stetner 06-17-2004 07:22 AM

From here (first google hit on '/var/empty ssh')
Quote:

Step 7: Set up privilege separation: A new security feature in response to OpenSSH challenge-response buffer overflow vulnerabilities is privilege separation. Previously any corruption in the sshd could lead to an immediate remote root compromise if it happened before authentication, and to local root compromise if it happend after authentication. Privilege Separation makes such compromise very difficult if not impossible. To set up sshd to use privilege separation execute the following commands: (source:README.privsep file)




# mkdir /var/empty
# chown root:sys /var/empty
# chmod 755 /var/empty
# groupadd sshd
# useradd -g sshd -c 'sshd privsep' -d /var/empty -s /bin/false sshd


/var/empty should not contain any files.
Does the 'privilege separation' bit ring any bells?? I think something must have changed on the server. You also might want to make sure /var/empty is set up correctly as mentioned above.

I suppose it is possible that this 'privilege separation' thing only happens on the server for new versions of the client, but that seems pretty weird if it is so....

PS. told you the server was dying! :D (couldn't resist)

bluehz 06-17-2004 07:37 AM

Very interesting! Thx!


All times are GMT -5. The time now is 08:52 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.