The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   UNIX - General (http://hintsforums.macworld.com/forumdisplay.php?f=16)
-   -   Help me connect SSH passwordlessly (http://hintsforums.macworld.com/showthread.php?t=34977)

Gnarlodious 02-12-2005 07:39 PM

Help me connect SSH passwordlessly
 
I'm sure I've done everything right on both machines. Can anyone see what I'm doing wrong?

Here's the entire verbose output:

Code:

~ > ssh -2vvv Rachel@Gnarlodious-Tibook.local
OpenSSH_3.6.1p1+CAN-2004-0175, 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 Gnarlodious-Tibook.local [fe80:4::203:93ff:fea3:8602] port 22.
debug1: Connection established.
debug3: Not a RSA1 key file /Volumes/Rachel/.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 /Volumes/Rachel/.ssh/id_rsa type 1
debug1: identity file /Volumes/Rachel/.ssh/id_dsa type -1
debug1: Remote protocol version 1.99, remote software version OpenSSH_3.6.1p1+CAN-2004-0175
debug1: match: OpenSSH_3.6.1p1+CAN-2004-0175 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.6.1p1+CAN-2004-0175
debug3: Trying to reverse map address fe80::203:93ff:fea3:8602.
debug1: An invalid name was supplied
Hostname cannot be canonicalized

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

debug1: An invalid name was supplied
Hostname cannot be canonicalized

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-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: 126/256
debug2: bits set: 1567/3191
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug3: check_host_in_hostfile: filename /Volumes/Rachel/.ssh/known_hosts
debug3: check_host_in_hostfile: match line 1
debug3: check_host_in_hostfile: filename /Volumes/Rachel/.ssh/known_hosts
debug3: check_host_in_hostfile: match line 1
debug1: Host 'gnarlodious-tibook.local' is known and matches the RSA host key.
debug1: Found key in /Volumes/Rachel/.ssh/known_hosts:1
debug2: bits set: 1588/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,password,keyboard-interactive
debug3: start over, passed a different list gssapi,publickey,password,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
Hostname cannot be canonicalized


debug1: Authentications that can continue: gssapi,publickey,password,keyboard-interactive
debug2: we sent a gssapi packet, wait for reply
debug1: Authentications that can continue: gssapi,publickey,password,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 public key: /Volumes/Rachel/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: gssapi,publickey,password,keyboard-interactive
debug1: Trying private key: /Volumes/Rachel/.ssh/id_dsa
debug3: no such identity: /Volumes/Rachel/.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
debug1: Authentications that can continue: gssapi,publickey,password,keyboard-interactive
debug3: userauth_kbdint: disable: no info_req_seen
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred:
debug3: authmethod_is_enabled password
debug1: Next authentication method: password
Rachel@gnarlodious-tibook.local's password:

~ >


Gnarlodious 02-12-2005 11:13 PM

Here's a clue
 
More information, I said this on my TiBook:

Code:

sudo SystemStarter -v restart SSH
and I got this reply:

Code:

Unknown service: SSH
Does SSH need to be configured? All my study of the subject leads me to believe it works out of the box. I've never seen anywhere OSX needs to have SSH turned on.

Please explain.

carouzal 02-12-2005 11:37 PM

In Preferences > Sharing is Remote Logon checked?

Gnarlodious 02-13-2005 01:42 AM

Enabling SSH
 
Yes, Remote Login is enabled. I know how unreliable that prefpane is so I toggled it a bit once but that didn't help.

I found a few interesting files at:
Code:

/etc/ssh_config
/etc/sshd_config

These look like configuration files. Should I be uncommenting some of those lines? I can't find any information how to enable SSH in OSX.

This is OS 10.3.7

mark hunte 02-13-2005 06:51 AM

check these hints out from the main Hints pages

http://www.macosxhints.com/article.p...11207004643312

also this is the latest hint on the hints site which is related to ssh.
http://www.macosxhints.com/article.p...05021023215253

carouzal 02-13-2005 07:37 AM

Quote:

Originally Posted by Gnarlodious
I found a few interesting files at:
Code:

/etc/ssh_config
/etc/sshd_config


All you have to do is check Remote Logon in the Sharing Prefs.
The default ssh_config & sshd_config files will allow connections to be made.
Do you have the os x firewall turned on? if so is port 22 open?
Are you connecting between any Hardware firewalls?
What happens if you type ssh 127.0.0.1 on the machine in question instead of from a remote machine?

Gnarlodious 02-13-2005 09:36 AM

I'm blue in the face
 
I think I've read every SSH hint on this website until I'm blue in the face. this is about the third week I've been working on this problem.

Yes, port 22 seems to be open on both machines, according to the prefpanel.

system.log reports this trying to log into 127.0.0.1 on my TiBook:

Code:

Feb 13 07:40:56 Gnarlodious-TiBook xinetd[268]: service ssh, IPV6_ADDRFORM setsockopt() failed: Protocol not available (errno = 42)
Feb 13 07:40:56 Gnarlodious-TiBook xinetd[268]: START: ssh pid=12726 from=127.0.0.1
Feb 13 07:41:24 Gnarlodious-TiBook sshd[12726]: Authentication refused: bad ownership or modes for directory /Volumes/Rachel

Here's what I get from Terminal trying to log into 127.0.0.1 on my TiBook:

Code:

~/.ssh > ssh -2vvv 127.0.0.1
OpenSSH_3.6.1p1+CAN-2004-0175, 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 127.0.0.1 [127.0.0.1] port 22.
debug1: Connection established.
debug3: Not a RSA1 key file /Volumes/Rachel/.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 /Volumes/Rachel/.ssh/id_rsa type 1
debug1: identity file /Volumes/Rachel/.ssh/id_dsa type -1
debug1: Remote protocol version 1.99, remote software version OpenSSH_3.6.1p1+CAN-2004-0175
debug1: match: OpenSSH_3.6.1p1+CAN-2004-0175 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.6.1p1+CAN-2004-0175
debug3: Trying to reverse map address 127.0.0.1.
debug1: An invalid name was supplied
Configuration file does not specify default realm

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

debug1: An invalid name was supplied
Configuration file does not specify default realm

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-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: 115/256
debug2: bits set: 1603/3191
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug3: check_host_in_hostfile: filename /Volumes/Rachel/.ssh/known_hosts
debug3: check_host_in_hostfile: match line 1
debug1: Host '127.0.0.1' is known and matches the RSA host key.
debug1: Found key in /Volumes/Rachel/.ssh/known_hosts:1
debug2: bits set: 1613/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,password,keyboard-interactive
debug3: start over, passed a different list gssapi,publickey,password,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
debug1: An invalid name was supplied
Configuration file does not specify default realm

debug1: An invalid name was supplied
Configuration file does not specify default realm

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 public key: /Volumes/Rachel/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: gssapi,publickey,password,keyboard-interactive
debug1: Trying private key: /Volumes/Rachel/.ssh/id_dsa
debug3: no such identity: /Volumes/Rachel/.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
debug1: Authentications that can continue: gssapi,publickey,password,keyboard-interactive
debug3: userauth_kbdint: disable: no info_req_seen
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred:
debug3: authmethod_is_enabled password
debug1: Next authentication method: password
Rachel@127.0.0.1's password:

~/.ssh >


carouzal 02-13-2005 09:42 AM

send the result of the following on both machines:
"sudo ipfw show"

"cat /etc/sshd_config" on the machine you are trying to connect to
"cat /etc/ssh_config" on the machine you are using to connect

Also what files are in ~/.ssh/

Gnarlodious 02-13-2005 09:50 AM

Results from TiBook
 
here are the results from one machine, the TiBook:

Code:

~/.ssh > ls -a
total 48
drwx------  7 Rachel  admin  238 13 Feb 07:32 .
drwxrwxrwx  37 Rachel  admin  1258 12 Feb 14:00 ..
-rw-------  1 Rachel  admin  6148 12 Feb 17:48 .DS_Store
-rw-------  1 Rachel  admin  233  9 Feb 10:08 authorized_keys2
-rw-------  1 Rachel  admin  887 13 Feb 07:32 id_rsa
-rw-r--r--  1 Rachel  admin  235 13 Feb 07:32 id_rsa.pub
-rw-r--r--  1 Rachel  admin  219 13 Feb 07:21 known_hosts
~/.ssh >




Code:

~/.ssh > sudo ipfw show
02000 384927  28969802 allow ip from any to any via lo*
02010      0        0 deny ip from 127.0.0.0/8 to any in
02020      0        0 deny ip from any to 127.0.0.0/8 in
02030      0        0 deny ip from 224.0.0.0/3 to any in
02040      0        0 deny tcp from any to 224.0.0.0/3 in
02050 920885 715878154 allow tcp from any to any out
02060 912367 571041309 allow tcp from any to any established
02070      0        0 allow tcp from any to any 3031 in
02080    12      720 allow tcp from any to any 548 in
02090      0        0 allow tcp from any to any 427 in
02100    10      600 allow tcp from any to any 22 in
02110      0        0 allow tcp from any to any 5297 in
02120      0        0 allow tcp from any to any 5298 in
02130      0        0 allow tcp from any to any 80 in
02140      0        0 allow tcp from any to any 427 in
02150    28      1344 allow tcp from any to any 139 in
02160      1        60 allow tcp from any to any 3689 in
12190    242    13576 deny tcp from any to any
65535  32420  6745655 allow ip from any to any
~/.ssh >





Code:

~/.ssh > cat /etc/sshd_config
#      $OpenBSD: sshd_config,v 1.59 2002/09/25 11:17:16 markus Exp $

# This is the sshd server system-wide configuration file.  See
# sshd_config(5) for more information.

# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented.  Uncommented options change a
# default value.

#Port 22
#Protocol 2,1
#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

# Authentication:

#LoginGraceTime 120
#PermitRootLogin yes
#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
~/.ssh >






Code:

~/.ssh > cat /etc/ssh_config
#      $OpenBSD: ssh_config,v 1.16 2002/07/03 14:21:05 markus Exp $

# This is the ssh client system-wide configuration file.  See
# ssh_config(5) for more information.  This file provides defaults for
# users, and the values can be changed in per-user configuration files
# or on the command line.

# Configuration data is parsed as follows:
#  1. command line options
#  2. user-specific file
#  3. system-wide file
# Any configuration value is only changed the first time it is set.
# Thus, host-specific definitions should be at the beginning of the
# configuration file, and defaults at the end.

# Site-wide defaults for various options

# Host *
#  ForwardAgent no
#  ForwardX11 no
#  RhostsAuthentication no
#  RhostsRSAAuthentication no
#  RSAAuthentication yes
#  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
#  Cipher 3des
#  Ciphers aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc
#  EscapeChar ~
~/.ssh >


Gnarlodious 02-13-2005 10:05 AM

While following your instructions I found these files, which I thought I was saving in my userfolder:
Code:

~/.ssh > ls /private/etc/ssh_host*
-rw-------  1 root  wheel  668 12 Feb 15:00 /private/etc/ssh_host_dsa_key
-rw-r--r--  1 root  wheel  590 12 Feb 15:00 /private/etc/ssh_host_dsa_key.pub
-rw-------  1 root  wheel  515 12 Feb 15:00 /private/etc/ssh_host_key
-rw-r--r--  1 root  wheel  319 12 Feb 15:00 /private/etc/ssh_host_key.pub
-rw-------  1 root  wheel  883 12 Feb 15:00 /private/etc/ssh_host_rsa_key
-rw-r--r--  1 root  wheel  210 12 Feb 15:00 /private/etc/ssh_host_rsa_key.pub
~/.ssh >

What's with these files? Where are they coming from? Could they cause a conflict?

Gnarlodious 02-13-2005 10:22 AM

Results from Cube
 
I'm also seeing the same files on this machine:
Code:

~ > ls /private/etc/ssh_h*
-rw-------  1 root  wheel  668 13 Feb 07:15 /private/etc/ssh_host_dsa_key
-rw-r--r--  1 root  wheel  590 13 Feb 07:15 /private/etc/ssh_host_dsa_key.pub
-rw-------  1 root  wheel  515 13 Feb 07:15 /private/etc/ssh_host_key
-rw-r--r--  1 root  wheel  319 13 Feb 07:15 /private/etc/ssh_host_key.pub
-rw-------  1 root  wheel  883 13 Feb 07:15 /private/etc/ssh_host_rsa_key
-rw-r--r--  1 root  wheel  210 13 Feb 07:15 /private/etc/ssh_host_rsa_key.pub
~ >

I sure don't know where these files are coming from.


When I try to connect I get this system.log report:
~ > ssh -2vvv 127.0.0.1
Code:

Feb 13 08:32:49 Gnarlodious-Cube xinetd[358]: service ssh, IPV6_ADDRFORM setsockopt() failed: Protocol not available (errno = 42)
Feb 13 08:32:49 Gnarlodious-Cube xinetd[358]: START: ssh pid=497 from=127.0.0.1
Feb 13 08:32:57 Gnarlodious-Cube sshd[497]: error: /etc/sshd_config: line 55: Bad configuration option: \303#
Feb 13 08:32:57 Gnarlodious-Cube sshd[497]: fatal: /etc/sshd_config: terminating, 1 bad configuration options



Code:

~ > ls ~/.ssh       
total 24
-rwxrwxrwx  1 Rachel  admin  883  9 Feb 10:08 id_rsa
-rwxrwxrwx  1 Rachel  admin  233  9 Feb 10:08 id_rsa.pub
-rw-r--r--  1 Rachel  admin  261 12 Feb 16:12 known_hosts
~ >



Code:

~ > ssh -2vvv 127.0.0.1
OpenSSH_3.6.1p1+CAN-2004-0175, 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 127.0.0.1 [127.0.0.1] port 22.
debug1: Connection established.
debug3: Not a RSA1 key file /Volumes/Rachel/.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 /Volumes/Rachel/.ssh/id_rsa type 1
debug1: identity file /Volumes/Rachel/.ssh/id_dsa type -1
ssh_exchange_identification: Connection closed by remote host
debug1: Calling cleanup 0x1c540(0x0)
~ >


Code:

~ > sudo ipfw show
02000 3130 220654 allow ip from any to any via lo*
02010    0      0 deny ip from 127.0.0.0/8 to any in
02020    0      0 deny ip from any to 127.0.0.0/8 in
02030    0      0 deny ip from 224.0.0.0/3 to any in
02040    0      0 deny tcp from any to 224.0.0.0/3 in
02050  849 100452 allow tcp from any to any out
02060  557 378790 allow tcp from any to any established
02070    0      0 allow tcp from any to any 3031 in
02080    0      0 allow tcp from any to any 548 in
02090    0      0 allow tcp from any to any 427 in
02100    0      0 allow tcp from any to any 22 in
02110    0      0 allow tcp from any to any 5297 in
02120    0      0 allow tcp from any to any 5298 in
02130    0      0 allow tcp from any to any 80 in
02140    0      0 allow tcp from any to any 427 in
02150    0      0 allow tcp from any to any 3689 in
12190    0      0 deny tcp from any to any
65535 1355 168515 allow ip from any to any
~ >



Code:

~ > cat /etc/sshd_config
#      $OpenBSD: sshd_config,v 1.59 2002/09/25 11:17:16 markus Exp $

# This is the sshd server system-wide configuration file.  See
# sshd_config(5) for more information.

# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented.  Uncommented options change a
# default value.

#Port 22
#Protocol 2,1
#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

# Authentication:

#LoginGraceTime 120
#PermitRootLogin yes
#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

~ >



Code:

~ > cat /etc/ssh_config
#      $OpenBSD: ssh_config,v 1.16 2002/07/03 14:21:05 markus Exp $

# This is the ssh client system-wide configuration file.  See
# ssh_config(5) for more information.  This file provides defaults for
# users, and the values can be changed in per-user configuration files
# or on the command line.

# Configuration data is parsed as follows:
#  1. command line options
#  2. user-specific file
#  3. system-wide file
# Any configuration value is only changed the first time it is set.
# Thus, host-specific definitions should be at the beginning of the
# configuration file, and defaults at the end.

# Site-wide defaults for various options

# Host *
#  ForwardAgent no
#  ForwardX11 no
#  RhostsAuthentication no
#  RhostsRSAAuthentication no
#  RSAAuthentication yes
#  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
#  Cipher 3des
#  Ciphers aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc
#  EscapeChar ~
~ >


Gnarlodious 02-13-2005 10:58 AM

Are these files part of the validation procedure?
 
OK, there was a stray character in the Cube's sshd_config file at:

?# To disable t ....

I removed it and it no longer errors out.

Now. saying
Code:

ssh -2vvv 127.0.0.1
causes the mystery files to be written:

~ > ls /private/etc/ssh_h*
-rw------- 1 root wheel 668 13 Feb 07:15 /private/etc/ssh_host_dsa_key
-rw-r--r-- 1 root wheel 590 13 Feb 07:15 /private/etc/ssh_host_dsa_key.pub
-rw------- 1 root wheel 515 13 Feb 07:15 /private/etc/ssh_host_key
-rw-r--r-- 1 root wheel 319 13 Feb 07:15 /private/etc/ssh_host_key.pub
-rw------- 1 root wheel 883 13 Feb 07:15 /private/etc/ssh_host_rsa_key
-rw-r--r-- 1 root wheel 210 13 Feb 07:15 /private/etc/ssh_host_rsa_key.pub

Are these files part of the validation procedure? What is their purpose?

carouzal 02-13-2005 10:59 AM

I will need some more time to look at this, but the one thing i noticed was the id_rsa and id_rsa.pub keys in ~/.ssh did you create those? try deleting or moving everything out of ~/.ssh on both machines and attempt the connection.

As soon as I have a few more minutes I will look through what I had you post and get back again.

Anyone else feel free to jump on this if you have time.

Gnarlodious 02-13-2005 11:21 AM

One problem solved!
 
YES! Deleting the stray character at line 55 now allows me to login remotely to my Cube. I still need to enter the password, but I'm closer.

I did remove all files from the .ssh folder and I can login both ways WITH a password.

system.log reports:

Feb 13 09:12:24 Gnarlodious-Cube xinetd[358]: START: ssh pid=690 from=fe80::203:93ff:fea3:8602
Feb 13 09:13:35 Gnarlodious-Cube sshd[690]: Accepted password for Rachel from fe80::203:93ff:fea3:8602 port 59115 ssh2

When I login remotely the mystery files ( /private/etc/ssh_h*) are created , I assume it's part of the process. Where the contents of those files are coming from I don't know.

Awaiting further advice...

carouzal 02-13-2005 01:55 PM

the files under /etc are system wide files and belong there.
Now i guess you are trying to setup passwordless ssh logons?

if so I have can post my notes on doing this..

blb 02-13-2005 04:41 PM

Quote:

Originally Posted by Gnarlodious
...
system.log reports this trying to log into 127.0.0.1 on my TiBook:

Code:

Feb 13 07:40:56 Gnarlodious-TiBook xinetd[268]: service ssh, IPV6_ADDRFORM setsockopt() failed: Protocol not available (errno = 42)
Feb 13 07:40:56 Gnarlodious-TiBook xinetd[268]: START: ssh pid=12726 from=127.0.0.1
Feb 13 07:41:24 Gnarlodious-TiBook sshd[12726]: Authentication refused: bad ownership or modes for directory /Volumes/Rachel

...

That "bad ownership" seems to be the issue; your homedir is coming from a seperately-mounted volume, correct (perhaps of your own doing, perhaps FileValut)? That "Authentication refused" probably means the permissions to /Volumes/Rachel are too open, what does
Code:

ls -ld /Volumes/Rachel
say?

Gnarlodious 02-14-2005 11:45 AM

My userfolder is a partition
 
OK, I've tried every imaginable combination of permissions and it still won't work.

My userfolder is a partition, that's why it's in the "Volumes" folder.

carouzal 02-14-2005 11:58 AM

from your latop type the following:
ssh-keygen -t rsa
choose the default path (Enter)
Password (Enter)
Password (Enter)

now look in .ssh and you should see id_rsa and id_rsa.pub.

now type:
where xxx.xxx.xxx.xxx is the ip of the cube and username is your username
scp ~/.ssh/id_rsa.pub username@xxx.xxx.xxx.xxx:~/.ssh/

Now ssh into the cube and type:
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys2
rm -f ~/.ssh/id_rsa.pub

Exit from the cube and try to reconnect, you should now be connected without being asked for a password.

carouzal 02-14-2005 12:00 PM

Is your user folder on an internal drive or firewire drive?

How did you move your home folder?

I thought a few posts above you said you could connect after fixing the line in the config?

My above post is how to ssh without a password.

Gnarlodious 02-14-2005 01:25 PM

Could it really be a permissions issue?
 
I tried that now and it doesn't work. After 45 seconds it asks for a password.

When I said I was able to login SSH, I meant I had never been able to before until I removed the corrupting character from that config file. How it got there I don't know, I didn't know the file existed until then.

My userfolder is on a nonejectable disk in the center partition. I set it in NetInfo Manager and it works well.

When I tried your advice just now, here is what the Cube's system.log showed:

Code:

Feb 14 10:49:50 Gnarlodious-Cube xinetd[354]: START: ssh pid=3973 from=fe80::203:93ff:fea3:8602
Feb 14 10:51:07 Gnarlodious-Cube sshd[3973]: Accepted password for Rachel from fe80::203:93ff:fea3:8602 port 51291 ssh2
Feb 14 10:53:59 Gnarlodious-Cube sshd[3973]: error: BSM audit: solaris_audit_record failed to write "sshd logout " record: Operation not supported
Feb 14 10:55:16 Gnarlodious-Cube xinetd[354]: START: ssh pid=4016 from=fe80::203:93ff:fea3:8602
Feb 14 10:56:04 Gnarlodious-Cube sshd[4016]: Authentication refused: bad ownership or modes for directory /Volumes/Rachel

Notice that the first 3 lines reflect the login before I set the authorized_keys2 file, and it asks for a password immediately.
In the last 2 lines I had set the e authorized_keys2 file on the Cube and tried to connect.

I don't understand what's wrong. Could it really be a permissions issue? Should I take this problem to the FreeBSD forums?

Gnarlodious 02-14-2005 10:55 PM

problem seems to be "on the other machine"
 
New information... I am able to login to my router passwordlessly, which is running a thin Linux client. In fact, I can login passwordlessly from both Macs!

So, the big problem seems to be "on the other machine" regardless of which Mac I am connecting from.

Gnarlodious 02-14-2005 11:42 PM

Solved!!!
 
Well, the previous poster who said the permissions of my userfolder was partially right. Actually the owner of folder /Volumes/Rachel was set to group "nobody" and that's apparently enough to raise the red flag.

It's possible that when I created the partition a few years ago that's the ownership that was given it and it just never changed.

Thanks guys, your guidance has been of astronomical value :D

carouzal 02-15-2005 12:06 AM

Glad it is resolved... nice to see you have been up and running 2 years on the same install... Try that on windows and let me know how you make out...LOL

The info I posted on ssh with no password is solid, I have used it for mac to mac, mac to linux, etc.. without fail... If it did not work then you may still have some config issues somewhere.

I would suggest when upgrading to Tiger (if you do) that you do a clean install, you will resolve a ton of issues that have been compounding since 10.X.X.

Gnarlodious 02-15-2005 02:22 AM

Roger that!
 
Yeah, when 10.4 hits the shelves I'm hoping it fixes a number of problems.

After some experimentation it turns out the most liberal permissions SSH allows on your userfolder is 750. Odd that I searched Google for days and didn't find any mention of this limitation.

But I think I have a firm grasp of secure logins now :rolleyes:

forbin 02-16-2005 03:14 PM

Quote:

Originally Posted by carouzal
scp ~/.ssh/id_rsa.pub [email]username@xxx.xxx.xxx.xxx:~/.ssh
Now ssh into the cube and type:
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys2
rm -f ~/.ssh/id_rsa.pub

Just an fyi .. You can do this in one step ...

Cat 'your public key' | ssh username@xxxx "cat >> .ssh/authorized_keys2"

You will be prompted for username's password (Since your public key is not yet in)

Gnarlodious 02-16-2005 03:37 PM

Yes, it does work!
 
Quote:

Originally Posted by forbin
Cat 'your public key' | ssh username@xxxx "cat >> .ssh/authorized_keys2"

Yes, it works!
I thought only scp prompted for a password but I guess ssh does also.


All times are GMT -5. The time now is 06:00 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.