Search code examples
sshsambassh-keys

SSH key access won't work after tinkering with Samba on server


I spent some time logged into a server (Debian) trying to get Samba access to work better from my Mac.

After logging out and attempting to log back in I was unable to log in using my private key which has been working for years.

Private key login worked for another user from the same client machine, and I was able to modify the sshd.config to allow password login so that I could log back onto the server.

What could I have done to break the keyed login just for my username and why?

I was messing around with creating a Samba password for my username, and I also made my home folder 777 to try to get write access working from Samba. (This was NOT a recursive chmod so the folders below are not 777.)


Solution

  • Your home directory should never be ugo+rwx (777). You should not allow other users to write to your home directory. The ssh daemon checks for file system permissions and will refuse to use the contents of ~/.ssh/ if it or its parent (~/) is writable by other users.

    See http://www.openssh.org/faq.html question # 3.14.

    Also see 'man sshd_config' and StrictModes (don't turn it off).

    Hope this helps.