ssh authorized_key working for user, but not for root - SSH

This is a discussion on ssh authorized_key working for user, but not for root - SSH ; Now I can establish a tunnel, but only with an administrative user, not with root /home/josh/.ssh/authorized_keys and not /root/.ssh/authorized_keys I've tried toggling the 'Allow root to login' setting in sshd_conf, but to no avail. What am I missing? thanks so ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: ssh authorized_key working for user, but not for root

  1. ssh authorized_key working for user, but not for root

    Now I can establish a tunnel, but only with an administrative user, not
    with root

    /home/josh/.ssh/authorized_keys

    and not

    /root/.ssh/authorized_keys


    I've tried toggling the 'Allow root to login' setting in sshd_conf, but
    to no avail.

    What am I missing? thanks so much in advance....

    josh


  2. Re: ssh authorized_key working for user, but not for root

    >
    > Now I can establish a tunnel, but only with an administrative user, not
    > with root
    >
    > /home/josh/.ssh/authorized_keys
    >
    > and not
    >
    > /root/.ssh/authorized_keys
    >
    >
    > I've tried toggling the 'Allow root to login' setting in sshd_conf, but
    > to no avail.
    >
    > What am I missing? thanks so much in advance....


    http://www.snailbook.com/faq/general...ging.auto.html

    --
    Richard Silverman
    res@qoxp.net


  3. Re: ssh authorized_key working for user, but not for root

    Thanks you for the direction. I've included my client and server in
    debug mode. There are little if no ssh mentions in /var/log/messages.
    I have also included my sshd_config file at the bottom.


    CLIENT LOG

    joshs-g4-ibook:~/.ssh josh$ ssh -vvv 198.65.45.199
    OpenSSH_3.8.1p1, OpenSSL 0.9.7g 11 Apr 2005
    debug1: Reading configuration data /etc/ssh_config
    debug2: ssh_connect: needpriv 0
    debug1: Connecting to 198.65.45.199 [198.65.45.199] port 22.
    debug1: Connection established.
    debug1: identity file /Users/josh/.ssh/identity type -1
    debug3: Not a RSA1 key file /Users/josh/.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 /Users/josh/.ssh/id_rsa type 1
    debug3: Not a RSA1 key file /Users/josh/.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 /Users/josh/.ssh/id_dsa type 2
    debug1: Remote protocol version 1.99, remote software version
    OpenSSH_4.2
    debug1: match: OpenSSH_4.2 pat OpenSSH*
    debug1: Enabling compatibility mode for protocol 2.0
    debug1: Local version string SSH-2.0-OpenSSH_3.8.1p1
    debug3: Trying to reverse map address 198.65.45.199.
    Address 198.65.45.199 maps to jhmail.com, but this does not map back to
    the address - POSSIBLE BREAKIN ATTEMPT!
    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,aes128-ctr,aes192-ctr,aes256-ctr
    debug2: kex_parse_kexinit:
    aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
    debug2: kex_parse_kexinit:
    hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit:
    hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: none,zlib
    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-group14-sha1,diffie-hellman-group1-sha1
    debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
    debug2: kex_parse_kexinit:
    aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
    debug2: kex_parse_kexinit:
    aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
    debug2: kex_parse_kexinit:
    hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit:
    hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: none,zlib@openssh.com
    debug2: kex_parse_kexinit: none,zlib@openssh.com
    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: 129/256
    debug2: bits set: 532/1024
    debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
    debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
    debug3: check_host_in_hostfile: filename /Users/josh/.ssh/known_hosts
    debug3: check_host_in_hostfile: match line 1
    debug1: Host '198.65.45.199' is known and matches the RSA host key.
    debug1: Found key in /Users/josh/.ssh/known_hosts:1
    debug2: bits set: 519/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: /Users/josh/.ssh/identity (0x0)
    debug2: key: /Users/josh/.ssh/id_rsa (0x307400)
    debug2: key: /Users/josh/.ssh/id_dsa (0x300c70)
    debug1: Authentications that can continue: publickey,password
    debug3: start over, passed a different list publickey,password
    debug3: preferred
    gssapi-with-mic,gssapi,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: /Users/josh/.ssh/identity
    debug3: no such identity: /Users/josh/.ssh/identity
    debug1: Offering public key: /Users/josh/.ssh/id_rsa
    debug3: send_pubkey_test
    debug2: we sent a publickey packet, wait for reply
    debug1: Authentications that can continue: publickey,password
    debug1: Offering public key: /Users/josh/.ssh/id_dsa
    debug3: send_pubkey_test
    debug2: we sent a publickey packet, wait for reply
    debug1: Authentications that can continue: publickey,password
    debug2: we did not send a packet, disable method
    debug3: authmethod_lookup password
    debug3: remaining preferred: ,password
    debug3: authmethod_is_enabled password
    debug1: Next authentication method: password
    josh@198.65.45.199's password:





    SERVER LOG IN DEBUG MODE

    jhmail /# /usr/sbin/sshd -d -p 1234
    debug1: sshd version OpenSSH_4.2p1
    debug1: private host key: #0 type 0 RSA1
    debug1: read PEM private key done: type RSA
    debug1: private host key: #1 type 1 RSA
    debug1: read PEM private key done: type DSA
    debug1: private host key: #2 type 2 DSA
    debug1: rexec_argv[0]='/usr/sbin/sshd'
    debug1: rexec_argv[1]='-d'
    debug1: rexec_argv[2]='-p'
    debug1: rexec_argv[3]='1234'
    debug1: Bind to port 1234 on 0.0.0.0.
    Server listening on 0.0.0.0 port 1234.
    Generating 768 bit RSA key.
    RSA key generation complete.
    debug1: fd 4 clearing O_NONBLOCK
    debug1: Server will not fork when running in debugging mode.
    debug1: rexec start in 4 out 4 newsock 4 pipe -1 sock 7
    debug1: inetd sockets after dupping: 3, 3
    debug1: res_init()
    Connection from 69.145.117.128 port 50378
    debug1: Client protocol version 2.0; client software version
    OpenSSH_3.8.1p1
    debug1: match: OpenSSH_3.8.1p1 pat OpenSSH_3.*
    debug1: Enabling compatibility mode for protocol 2.0
    debug1: Local version string SSH-1.99-OpenSSH_4.2
    debug1: permanently_set_uid: 22/22
    debug1: list_hostkey_types: ssh-rsa,ssh-dss
    debug1: SSH2_MSG_KEXINIT sent
    debug1: SSH2_MSG_KEXINIT received
    debug1: kex: client->server aes128-cbc hmac-md5 none
    debug1: kex: server->client aes128-cbc hmac-md5 none
    debug1: SSH2_MSG_KEX_DH_GEX_REQUEST received
    debug1: SSH2_MSG_KEX_DH_GEX_GROUP sent
    debug1: expecting SSH2_MSG_KEX_DH_GEX_INIT
    debug1: SSH2_MSG_KEX_DH_GEX_REPLY sent
    debug1: SSH2_MSG_NEWKEYS sent
    debug1: expecting SSH2_MSG_NEWKEYS
    debug1: SSH2_MSG_NEWKEYS received
    debug1: KEX done
    debug1: userauth-request for user josh service ssh-connection method
    none
    debug1: attempt 0 failures 0
    Failed none for josh from 69.145.117.128 port 50378 ssh2
    Failed none for josh from 69.145.117.128 port 50378 ssh2
    debug1: userauth-request for user josh service ssh-connection method
    publickey
    debug1: attempt 1 failures 1
    debug1: test whether pkalg/pkblob are acceptable
    debug1: trying public key file /home/josh/.ssh/authorized_keys
    debug1: trying public key file /home/josh/.ssh/authorized_keys
    Failed publickey for josh from 69.145.117.128 port 50378 ssh2
    debug1: userauth-request for user josh service ssh-connection method
    publickey
    debug1: attempt 2 failures 2
    debug1: test whether pkalg/pkblob are acceptable
    debug1: trying public key file /home/josh/.ssh/authorized_keys
    debug1: trying public key file /home/josh/.ssh/authorized_keys
    Failed publickey for josh from 69.145.117.128 port 50378 ssh2



    HERE IS MY sshd_config FILE


    jhmail /etc/ssh# cat 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/ssh_host_key
    # HostKeys for protocol version 2
    #HostKey /etc/ssh/ssh_host_rsa_key
    #HostKey /etc/ssh/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 no
    PermitRootLogin without-password
    #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/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
    ChallengeResponseAuthentication no

    # 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 yes
    #X11DisplayOffset 10
    X11UseLocalhost no
    #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/libexec/sftp-server
    jhmail /etc/ssh#



    Thanks so much in advance-

    josh


  4. Re: ssh authorized_key working for user, but not for root

    In article <1130686202.532221.133280@g43g2000cwa.googlegroups. com>,
    joshthree wrote:
    >joshs-g4-ibook:~/.ssh josh$ ssh -vvv 198.65.45.199
    >OpenSSH_3.8.1p1, OpenSSL 0.9.7g 11 Apr 2005
    >debug1: Reading configuration data /etc/ssh_config
    >debug2: ssh_connect: needpriv 0
    >debug1: Connecting to 198.65.45.199 [198.65.45.199] port 22.
    >debug1: Connection established.
    >debug1: identity file /Users/josh/.ssh/identity type -1
    >debug3: Not a RSA1 key file /Users/josh/.ssh/id_rsa.
    >debug2: key_type_from_name: unknown key type '-----BEGIN'


    Looks like you have an SSH2 key that you're trying to use
    with ssh version 1. Try ssh2 instead of ssh.

    Arnoud

    --
    Arnoud Engelfriet, Dutch & European patent attorney - Speaking only for myself
    Patents, copyright and IPR explained for techies: http://www.iusmentis.com/

  5. Re: ssh authorized_key working for user, but not for root

    It turns out that the problem was that the user on my client and on the
    server was the same name, so when I typed in:

    ssh ip.add.re.ss

    it was assuming my user name instead of the root user.

    by typing

    ssh -l root ip.add.re.ss

    it worked fine. Thanks for looking at that..

    josh


+ Reply to Thread