"Connection closed by" error

OS: Solaris 8 Sparc

server1:userA:/home/userA# ssh userB@server1
Connection closed by < IP address>

Problem: From being a userA, I am unable to connect/ssh to the same server as when trying to use a different account. (userB)

Do you know where can i start checking? Here are some additional info.

  • ssh service is up and running.
  • userA and userB has a similar account setup

Try looking at the debug info from:

ssh -vvv userB@server1

Also, you can truss the process.

Is the connection being closed after prompting for a password?

your userB is root?

it doesn't prompt for password.

---------- Post updated at 11:47 AM ---------- Previous update was at 11:46 AM ----------

User A and B are both normal user with the same group.

---------- Post updated at 12:06 PM ---------- Previous update was at 11:47 AM ----------

Here is some of the debug output

   server1:userA:/home/userA# ssh -vvv server1 -l userB
  
OpenSSH_3.8.1p1, OpenSSL 0.9.7d 17 Mar 2004
  debug1: Reading configuration data /etc/ssh/ssh_config
  debug1: Applying options for *
  debug3: RNG is ready, skipping seeding
  debug2: ssh_connect: needpriv 0
  debug1: Connecting to server1 [XXX.XXX.XX.XX] port 22.
  debug1: Connection established.
  debug1: identity file /home/userA/.ssh/identity type -1
  debug3: Not a RSA1 key file /home/userA/.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
  debug2: key_type_from_name: unknown key type '-----END'
  debug3: key_read: missing keytype
  debug1: identity file /home/userA/.ssh/id_rsa type 1
  debug3: Not a RSA1 key file /home/userA/.ssh/id_dsa.
  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
  debug2: key_type_from_name: unknown key type '-----END'
  debug3: key_read: missing keytype
  debug1: identity file /home/userA/.ssh/id_dsa type 2
  debug1: Remote protocol version 2.0, remote software version OpenSSH_3.8.1p1
  debug1: match: OpenSSH_3.8.1p1 pat OpenSSH*
  debug1: Enabling compatibility mode for protocol 2.0
  debug1: Local version string SSH-2.0-OpenSSH_3.8.1p1
  debug3: RNG is ready, skipping seeding
  debug1: SSH2_MSG_KEXINIT sent
  debug1: SSH2_MSG_KEXINIT received
  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(1024<1024<8192) sent
  debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
  debug2: dh_gen_key: priv key bits set: 145/256
  debug2: bits set: 522/1024
  debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
  debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
  debug3: check_host_in_hostfile: filename /home/userA/.ssh/known_hosts
  debug3: check_host_in_hostfile: match line 15
  debug3: check_host_in_hostfile: filename /home/userA/.ssh/known_hosts
  debug3: check_host_in_hostfile: match line 15
  debug1: Host 'server1' is known and matches the RSA host key.
  debug1: Found key in /home/userA/.ssh/known_hosts:15
  debug2: bits set: 521/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/userA/.ssh/identity (0)
  debug2: key: /home/userA/.ssh/id_rsa (122a80)
  debug2: key: /home/userA/.ssh/id_dsa (1203f8)
  debug1: Authentications that can continue: publickey,password,keyboard-interactive,hostbased
  debug3: start over, passed a different list publickey,password,keyboard-interactive,hostbased
  debug3: preferred hostbased,publickey,keyboard-interactive,password
  debug3: authmethod_lookup hostbased
  debug3: remaining preferred: publickey,keyboard-interactive,password
  debug3: authmethod_is_enabled hostbased
  debug1: Next authentication method: hostbased
  debug2: userauth_hostbased: chost server1.
  debug2: ssh_keysign called
  debug3: ssh_msg_send: type 2
  debug3: ssh_msg_recv entering
  debug2: we sent a hostbased packet, wait for reply
  debug1: Remote: Ignoring wild host/user names in /home/userB/.rhosts.
  debug1: Authentications that can continue: publickey,password,keyboard-interactive,hostbased
  debug2: userauth_hostbased: chost server1.
  debug2: ssh_keysign called
  debug3: ssh_msg_send: type 2
  debug3: ssh_msg_recv entering
  debug2: we sent a hostbased packet, wait for reply
  debug1: Remote: Ignoring wild host/user names in /home/userB/.rhosts.
  debug1: Authentications that can continue: publickey,password,keyboard-interactive,hostbased
  debug1: No more client hostkeys for hostbased authentication.
  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/userA/.ssh/identity
  debug3: no such identity: /home/userA/.ssh/identity
  debug1: Offering public key: /home/userA/.ssh/id_rsa
  debug3: send_pubkey_test
  debug2: we sent a publickey packet, wait for reply
  debug1: Authentications that can continue: publickey,password,keyboard-interactive,hostbased
  debug1: Offering public key: /home/userA/.ssh/id_dsa
  debug3: send_pubkey_test
  debug2: we sent a publickey packet, wait for reply
  Connection closed by XXX.XXX.XX.XX