LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   ssh won't connect with too many permissions (https://www.linuxquestions.org/questions/linux-newbie-8/ssh-wont-connect-with-too-many-permissions-891042/)

doru 07-11-2011 03:43 AM

ssh won't connect with too many permissions
 
I connect through ssh (putty) using a user authentication public key stored on the ssh server in ~/.ssh/authorized_keys. Permissions for ~ are 750. When I change them to 757 I can't connect anymore - connection by key is not accepted by server. How is this possible?

acid_kewpie 07-11-2011 03:45 AM

it's possible because that's the way it works. that data is PRIVATE and you're making ANYONE able to read it. So another user could trivially add a key to YOUR config and login as you. Why would you want to change it in the first place??

doru 07-11-2011 04:00 AM

Quote:

Originally Posted by acid_kewpie (Post 4411335)
it's possible because that's the way it works. that data is PRIVATE and you're making ANYONE able to read it. So another user could trivially add a key to YOUR config and login as you. Why would you want to change it in the first place??

You say that sshd checks the permissions for the home directory where ~/.ssh/authorized_keys is stored? The permissions for ~/.ssh are still 700, and for authorized_keys are 644 (read for everbody, write for owner).

I did this stupid thing while trying to make local mail work, but now it works with the right permissions. Anyway, are you sure that sshd is checking the permissions of the ~ directory? I did not expect this behaviour.

Thank you for your answer.

wpeckham 07-11-2011 01:49 PM

OpenSSH
 
Yes, it checks the permissions on your home folder.

Check out the man page.

anomie 07-11-2011 01:52 PM

Quote:

Originally Posted by doru
Anyway, are you sure that sshd is checking the permissions of the ~ directory? I did not expect this behaviour.

Yes. It's enabled by default (StrictModes), and this is a good thing.


All times are GMT -5. The time now is 03:41 PM.