ssh always asking for password

ssh always asking for password

Post by Javier Espino » Sat, 05 Jul 2003 21:01:19



Hi everybody,

Could someone help me on an openssh issue?

I have two servers with AIX 4.3.3-ML10.
I've installed the installp package from Bull website
(OpenSSH_3.6.1p2)
These are the steps I followed:

Generate dsa user key on both servers:
    ssh-keygen -t dsa
I then placed the contents of id_dsa into authorized_keys on the other
machine and vice-versa

ssh and scp and sftp works well from machineA to machineB without
asking password.

If I do the same operation in the reverse order, machineB to machineA,
I always got the prompt for entering the root password.

The config files: sshd_config and ssh_config are exactly the same on
both servers

Here is the debug output I get when it doesn't work:ssh -v -v -v s70
ls
OpenSSH_3.6.1p2, SSH protocols 1.5/2.0, OpenSSL 0x0090607f
debug3: Seeding PRNG from /usr/local/libexec/ssh-rand-helper
debug1: Rhosts Authentication disabled, originating port will not be
trusted.
debug2: ssh_connect: needpriv 0
debug1: Connecting to s70 [10.26.0.11] port 22.
debug1: Connection established.
debug1: identity file /.ssh/identity type -1
debug1: identity file /.ssh/id_rsa type -1
debug3: Not a RSA1 key file /.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
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 /.ssh/id_dsa type 2
debug1: Remote protocol version 2.0, remote software version
OpenSSH_3.6.1p2
debug1: match: OpenSSH_3.6.1p2 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.6.1p2
debug3: RNG is ready, skipping seeding
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-...@lysator.liu.se
debug2: kex_parse_kexinit:
aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,rijndael-...@lysator.liu.se
debug2: kex_parse_kexinit:
hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd...@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit:
hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd...@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-dss
debug2: kex_parse_kexinit:
aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,rijndael-...@lysator.liu.se
debug2: kex_parse_kexinit:
aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,rijndael-...@lysator.liu.se
debug2: kex_parse_kexinit:
hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd...@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit:
hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd...@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: 128/256
debug2: bits set: 1559/3191
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug3: check_host_in_hostfile: filename /.ssh/known_hosts
debug3: check_host_in_hostfile: match line 1
debug3: check_host_in_hostfile: filename /.ssh/known_hosts
debug3: check_host_in_hostfile: match line 1
debug1: Host 's70' is known and matches the DSA host key.
debug1: Found key in /.ssh/known_hosts:1
debug2: bits set: 1619/3191
debug1: ssh_dss_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:
publickey,password,keyboard-interactive
debug3: start over, passed a different list
publickey,password,keyboard-interactive
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /.ssh/identity
debug3: no such identity: /.ssh/identity
debug1: Trying private key: /.ssh/id_rsa
debug3: no such identity: /.ssh/id_rsa
debug1: Offering public key: /.ssh/id_dsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue:
publickey,password,keyboard-interactive
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:
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
root@s70's password:
....

This is my sshd_config file (ssh_config has been renamed to
ssh_config.old)

#       $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:/usr/local/bin

# 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
#ListenAddress 0.0.0.0
#ListenAddress ::

# HostKeys for protocol version 2
HostKey /usr/local/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 no
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
/usr/local/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 no

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

It looks like the function send_pubkey_test didn't receive an answer

Many Many thanks for your help

Regards

Javier Espinosa

 
 
 

ssh always asking for password

Post by Richard D. Lath » Sun, 06 Jul 2003 04:59:43



> Hi everybody,

> Could someone help me on an openssh issue?

> I have two servers with AIX 4.3.3-ML10.
> I've installed the installp package from Bull website
> (OpenSSH_3.6.1p2)
> These are the steps I followed:

> Generate dsa user key on both servers:
>     ssh-keygen -t dsa
> I then placed the contents of id_dsa into authorized_keys on the other
> machine and vice-versa

> ssh and scp and sftp works well from machineA to machineB without
> asking password.

> If I do the same operation in the reverse order, machineB to machineA,
> I always got the prompt for entering the root password.

> The config files: sshd_config and ssh_config are exactly the same on
> both servers

I had exactly this problem about 6 months ago, and, IIRC, it came down
to a directory permissions/ownership issue, probably of the ~/.ssh
directory for the user. ( It worked "properly" for every account
on the box except root ).

--
Richard D. Latham  



 
 
 

ssh always asking for password

Post by Darren Tuck » Sun, 06 Jul 2003 16:13:51




Quote:>I had exactly this problem about 6 months ago, and, IIRC, it came down
>to a directory permissions/ownership issue, probably of the ~/.ssh
>directory for the user. ( It worked "properly" for every account
>on the box except root ).

Also check the permissions and ownership of /.

If you run the server in debug mode, you can find out why it's denying
the authentication.  See:
http://www.snailbook.com/faq/general-debugging.auto.html

Note that running the client in debug mode probably won't help you.

--
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4  37C9 C982 80C7 8FF4 FA69
    Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.

 
 
 

ssh always asking for password

Post by RobH » Sun, 06 Jul 2003 20:26:12





> >I had exactly this problem about 6 months ago, and, IIRC, it came
down
> >to a directory permissions/ownership issue, probably of the ~/.ssh
> >directory for the user. ( It worked "properly" for every account
> >on the box except root ).

> Also check the permissions and ownership of /.

IIRC the default permissions of root's default home directory are
bin:bin and ssh doesn't like this.
One option is to change root's home directory from / to /root if you
don't want to change the ownership of /.

Quote:

> If you run the server in debug mode, you can find out why it's denying
> the authentication.  See:
> http://www.snailbook.com/faq/general-debugging.auto.html

> Note that running the client in debug mode probably won't help you.

> --
> Darren Tucker (dtucker at zip.com.au)
> GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4  37C9 C982 80C7 8FF4 FA69
>     Good judgement comes with experience. Unfortunately, the
experience
> usually comes from bad judgement.

--
RobH
The future's dim, the future's mono.
 
 
 

ssh always asking for password

Post by Andy » Mon, 07 Jul 2003 18:37:20




>>> to a directory permissions/ownership issue, probably of the ~/.ssh
>>> directory for the user. ( It worked "properly" for every account
>>> on the box except root ).

>> Also check the permissions and ownership of /.
> IIRC the default permissions of root's default home directory are
> bin:bin and ssh doesn't like this.
> One option is to change root's home directory from / to /root if you
> don't want to change the ownership of /.

It's always good practice to change roots default home directory. I use
/u/root but /root is equally as good. Create this directory 'mkdir -p
/u/root' and I set permissions to root.system and 750. Then just edit
/etc/passwd and change root's current directory '/' to '/u/root'. Save and
log back in. Another advantage of this is you don't get smit.script smit.log
.sh_history .ssh etc etc in the real 'root' directory keeping it nice and
tidy!!

If you use rsh, then you can also place .rhosts in /u/root.

Andy

 
 
 

ssh always asking for password

Post by RobH » Mon, 07 Jul 2003 19:54:27




"RobH"

> >>> to a directory permissions/ownership issue, probably of the ~/.ssh
> >>> directory for the user. ( It worked "properly" for every account
> >>> on the box except root ).

> >> Also check the permissions and ownership of /.
> > IIRC the default permissions of root's default home directory are
> > bin:bin and ssh doesn't like this.
> > One option is to change root's home directory from / to /root if you
> > don't want to change the ownership of /.

> It's always good practice to change roots default home directory. I
use
> /u/root but /root is equally as good. Create this directory 'mkdir -p
> /u/root' and I set permissions to root.system and 750. Then just edit
> /etc/passwd and change root's current directory '/' to '/u/root'. Save
and
> log back in. Another advantage of this is you don't get smit.script
smit.log
> .sh_history .ssh etc etc in the real 'root' directory keeping it nice
and
> tidy!!

> If you use rsh, then you can also place .rhosts in /u/root.

> Andy

I wouldn't recommend editing /etc/passwd directly.
Use "chuser home=/root root" just to be on the safe side.

--
RobH
The future's dim, the future's mono.

 
 
 

ssh always asking for password

Post by Javier Espino » Tue, 08 Jul 2003 16:15:54


Hi,

Changing the ownership of / to root.system (It was bin.bin) solved the problem.

Many thanks to all of you

Regards

Javier Espinosa





>  "RobH"

> > >>> to a directory permissions/ownership issue, probably of the ~/.ssh
> > >>> directory for the user. ( It worked "properly" for every account
> > >>> on the box except root ).

> > >> Also check the permissions and ownership of /.
> > > IIRC the default permissions of root's default home directory are
> > > bin:bin and ssh doesn't like this.
> > > One option is to change root's home directory from / to /root if you
> > > don't want to change the ownership of /.

> > It's always good practice to change roots default home directory. I
>  use
> > /u/root but /root is equally as good. Create this directory 'mkdir -p
> > /u/root' and I set permissions to root.system and 750. Then just edit
> > /etc/passwd and change root's current directory '/' to '/u/root'. Save
>  and
> > log back in. Another advantage of this is you don't get smit.script
>  smit.log
> > .sh_history .ssh etc etc in the real 'root' directory keeping it nice
>  and
> > tidy!!

> > If you use rsh, then you can also place .rhosts in /u/root.

> > Andy

> I wouldn't recommend editing /etc/passwd directly.
> Use "chuser home=/root root" just to be on the safe side.

 
 
 

1. KPPP always asks for root password!

Hi guys...

I am using kppp in RedHat Linux 6.1. Whenever I am logged in as anything
else than root, kppp asks for the root's password to allow me to dial
out. This happens even after I have tried both methods for restricting
access to kppp, as suggested by the program's documentation (i.e.,
either creating a new group, or using /etc/kppp.allow).

Is this a bug or am I doing something wrong?

Thanks,

Dimitris

Sent via Deja.com http://www.deja.com/
Before you buy.

2. Virual IP Addresses

3. How to use pub keys (not ssh password) in ssh command?

4. : max filesize

5. ssh change password & shadow password

6. crystal 4280 PCI soundcard

7. pam_ldap and password management and rsh/ssh without password

8. ata patch FAQs

9. smbclient asks for password but never accepts the password entered.

10. Tools to change password without ask new password twice time.

11. SSH Remote access Always getting: Disconnected; authentication error (No further authentication methods available).

12. oldconfig always asking for machine type (x86)

13. Don't always ask about Intel or AMD RNGs