FAQ
Hey all,


  Having a weird ssh issue I'd like some opinions on.


  If I have my home directory mounted on the NFS server itself, I get
permission denied when I try to ssh into it. The correct permissions and
ownership are on the home directory, ssh directory and the authorized_users
file.


Here's what a verbose ssh session looks like:


#ssh -v bluethundr at nfs1.example.com
OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: Connecting to nfs1.example.com [162.243.109.94] port 22.
debug1: Connection established.
debug1: identity file /Users/TimothyDunphy/.ssh/id_rsa type 1
debug1: identity file /Users/TimothyDunphy/.ssh/id_rsa-cert type -1
debug1: identity file /Users/TimothyDunphy/.ssh/id_dsa type -1
debug1: identity file /Users/TimothyDunphy/.ssh/id_dsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.2
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1
debug1: match: OpenSSH_6.6.1 pat OpenSSH*
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5-etm at openssh.com none
debug1: kex: client->server aes128-ctr hmac-md5-etm at openssh.com none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: RSA f7:06:1a:56:2f:0e:1b:bd:7b:e6:de:8c:9a:88:ea:09
debug1: Host 'nfs1.example.com' is known and matches the RSA host key.
debug1: Found key in /Users/TimothyDunphy/.ssh/known_hosts:19
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue:
publickey,gssapi-keyex,gssapi-with-mic
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/TimothyDunphy/.ssh/id_rsa
debug1: Authentications that can continue:
publickey,gssapi-keyex,gssapi-with-mic
debug1: Trying private key: /Users/TimothyDunphy/.ssh/id_dsa
debug1: No more authentication methods to try.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).


And I see this message in the secure log:


Jul 13 23:09:28 nfsdb1 sshd[15305]: Connection closed by xx.xx.xx.xx
  [preauth]


The IP that I xxx'd out is my client IP


Here's the permissions and ownership on the directories and files:


#ls -ld /home/bluethundr/ /home/bluethundr/.ssh
/home/bluethundr/.ssh/authorized_keys


drwxr-x---. 37 bluethundr bluethundr 4096 Jul 13 20:57 /home/bluethundr/


drw-------. 3 bluethundr bluethundr 4096 Jun 15 17:22 /home/bluethundr/.ssh


-rw-------. 1 bluethundr bluethundr 2614 Jun 15 17:22
/home/bluethundr/.ssh/authorized_keys


SELinux is set to permissve:


#getenforce
Permissive


If I unmount the nfs home directory I am able to log in:


[root at nfs1:~] #umount -l /home
[root at nfs1:~] #


#ssh bluethundr at nfs1.example.com
Last login: Mon Jul 13 23:08:35 2015 from ool-2f126f64.dyn.optonline.net
-bash-4.2$


The permissions on the non-nfs home directory are the same as the NFS
mounted home directory:


#ls -ld /home/bluethundr/ /home/bluethundr/.ssh
/home/bluethundr/.ssh/authorized_keys
drwxr-x---. 37 bluethundr bluethundr 4096 Jul 13 20:57 /home/bluethundr/
drw-------. 3 bluethundr bluethundr 4096 Jun 15 17:22 /home/bluethundr/.ssh
-rw-------. 1 bluethundr bluethundr 2614 Jun 15 17:22
/home/bluethundr/.ssh/authorized_keys


As soon as I mount it back, the issue returns and I am unable to ssh in:


#ssh bluethundr at nfs1.example.com
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).




I'd really appreciate any ideas you guys may have as to why this is
happening!!


Thanks,
Tim


--
GPG me!!


gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B

Search Discussions

  • Zep at Jul 14, 2015 at 11:43 am

    On 07/13/2015 11:14 PM, Tim Dunphy wrote:
    Here's the permissions and ownership on the directories and files:

    #ls -ld /home/bluethundr/ /home/bluethundr/.ssh
    /home/bluethundr/.ssh/authorized_keys

    drwxr-x---. 37 bluethundr bluethundr 4096 Jul 13 20:57 /home/bluethundr/

    drw-------. 3 bluethundr bluethundr 4096 Jun 15 17:22 /home/bluethundr/.ssh

    I'd expect this directory to be mode 700. also assuming that your id
    is actually 'bluethundr' and not 'TimDunphy' as before from ssh -v
    output. if you do have user ID collision between the machines it could
    add to the confusion.
    -rw-------. 1 bluethundr bluethundr 2614 Jun 15 17:22
    /home/bluethundr/.ssh/authorized_keys

    SELinux is set to permissve:

    #getenforce
    Permissive

    If I unmount the nfs home directory I am able to log in:

    [root at nfs1:~] #umount -l /home
    [root at nfs1:~] #

    #ssh bluethundr at nfs1.example.com
    Last login: Mon Jul 13 23:08:35 2015 from ool-2f126f64.dyn.optonline.net
    -bash-4.2$

    The permissions on the non-nfs home directory are the same as the NFS
    mounted home directory:

    #ls -ld /home/bluethundr/ /home/bluethundr/.ssh
    /home/bluethundr/.ssh/authorized_keys
    drwxr-x---. 37 bluethundr bluethundr 4096 Jul 13 20:57 /home/bluethundr/
    drw-------. 3 bluethundr bluethundr 4096 Jun 15 17:22 /home/bluethundr/.ssh
    -rw-------. 1 bluethundr bluethundr 2614 Jun 15 17:22
    /home/bluethundr/.ssh/authorized_keys

    As soon as I mount it back, the issue returns and I am unable to ssh in:

    #ssh bluethundr at nfs1.example.com
    Permission denied (publickey,gssapi-keyex,gssapi-with-mic).


    I'd really appreciate any ideas you guys may have as to why this is
    happening!!

    Thanks,
    Tim

    perhaps with a local mount it goes ahead and gives you the directory
    searching ability since you own the directory and it doesn't really make
    sense for you not to be able to do otherwise, but it can't do the same
    sort of logical override for NFS? I'm mostly shooting in the dark, but
    it's where I'd start.


    --
    public gpg key id: AE60F64C
  • Gordon Messmer at Jul 14, 2015 at 5:28 pm

    On 07/13/2015 08:14 PM, Tim Dunphy wrote:
    And I see this message in the secure log:
    Jul 13 23:09:28 nfsdb1 sshd[15305]: Connection closed by xx.xx.xx.xx
    [preauth]

    Is that the only message logged to the "secure" and "messages" files?

    As soon as I mount it back, the issue returns and I am unable to ssh in:

    #ssh bluethundr at nfs1.example.com
    Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

    Well, if the problem isn't the permissions on the files and your server
    is set to allow only public key and Kerberos (GSSAPI) logins, then the
    obvious thing to check would be that you have the right key in that NFS
    mounted home directory. Are you sure it's the same as the one in the
    local home directory?

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcentos @
categoriescentos
postedJul 14, '15 at 3:14a
activeJul 14, '15 at 5:28p
posts3
users3
websitecentos.org
irc#centos

3 users in discussion

Gordon Messmer: 1 post Zep: 1 post Tim Dunphy: 1 post

People

Translate

site design / logo © 2021 Grokbase