Gr33nGapion
August 2nd, 2014, 04:25 AM
This is my first time setting up an SSH server so that it only accepts RSA keys for authentication. I noticed that when I run ssh in debug mode with this command:
$sudo /usr/sbin/sshd -ddd
I get these peculiar debug lines in the server just as the client is attempting to authenticate:
...
debug1: temporarily_use_uid: 1001/1001 (e=0/0)
debug1: trying public key file /home/public/.ssh/authorized_keys
debug1: fd 4 clearing O_NONBLOCK
debug1: matching key found: file /home/public/.ssh/authorized_keys, line 1
...
uid 1001 matches the user account which I am attempting to use to log in named "public."
The authorized_keys file is located in /home/public/.ssh/authorized_keys with permissions 600, owner=public.
HOWEVER. I plan on giving the credentials for this user account to several different people and I would prefer it if the authorized_keys file was owned by ROOT so that they can't just copy in a new public key and add access to a third party. When I simply make the file owned by the root user, the server prints this on a debug line:
Could not open authorized keys '/home/public/.ssh/authorized_keys': Permission denied
Is there something I can do in the sshd config file to make the server access the authorized_keys file as root?
Any help is appreciated.
$sudo /usr/sbin/sshd -ddd
I get these peculiar debug lines in the server just as the client is attempting to authenticate:
...
debug1: temporarily_use_uid: 1001/1001 (e=0/0)
debug1: trying public key file /home/public/.ssh/authorized_keys
debug1: fd 4 clearing O_NONBLOCK
debug1: matching key found: file /home/public/.ssh/authorized_keys, line 1
...
uid 1001 matches the user account which I am attempting to use to log in named "public."
The authorized_keys file is located in /home/public/.ssh/authorized_keys with permissions 600, owner=public.
HOWEVER. I plan on giving the credentials for this user account to several different people and I would prefer it if the authorized_keys file was owned by ROOT so that they can't just copy in a new public key and add access to a third party. When I simply make the file owned by the root user, the server prints this on a debug line:
Could not open authorized keys '/home/public/.ssh/authorized_keys': Permission denied
Is there something I can do in the sshd config file to make the server access the authorized_keys file as root?
Any help is appreciated.