2

The home directories on a server are mounted at /mnt/Storage/Home, and I have a symlink at /srv/Home pointing to that directory. I can log into accounts on it and the home directory works fine, but I cannot use my ssh key to login. It prompts me for a password instead.

I checked permissions on the .ssh directory and files and they're set correctly, but it still doesn't work.

drwx------  2 cclloyd cclloyd    6 Apr 13  2019 .
drwxrw---- 30 cclloyd cclloyd   55 Sep 17 01:50 ..
-rw-r--r--  1 cclloyd cclloyd 1616 Apr 13  2019 authorized_keys
-rw-------  1 cclloyd cclloyd 1675 Sep 18  2018 id_rsa
-rw-r--r--  1 cclloyd cclloyd  415 Sep 18  2018 id_rsa.pub
-rw-r--r--  1 cclloyd cclloyd 1110 Oct 13 03:12 known_hosts

Is there a way to get SSH keys to work with symbolic links?

3
  • Check the syslog on the server to see if sshd is logging any complaints about your home directory. It'd be helpful to know what exact message you're getting, if any.
    – Kenster
    Commented Nov 12, 2019 at 2:50
  • @Kenster Nov 12 02:44:26 singularity sshd[11731]: Authentication refused: bad ownership or modes for directory /mnt/Storagea/Home/cclloyd. Turns out your home directory needs to be 700 or else it won't work. Thanks.
    – cclloyd
    Commented Nov 12, 2019 at 2:54
  • 1
    Actually I believe your home directory can't be group- or world-writable. 755 is fine.
    – Kenster
    Commented Nov 12, 2019 at 3:02

1 Answer 1

0

Turns out your home directory itself also needs to be 700 or else it won't work. Full required permissions below.

drwx------ .
drwx------ ..
-rw-r--r-- authorized_keys
-rw------- id_rsa
-rw-r--r-- id_rsa.pub
-rw-r--r-- known_hosts

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .