I dont want that the user has access to the ssh key via sftp and ftp. Is there a way to change the directory or revoke the permissions, even to see the .ssh directory ? Have not found anything with google.
Im using debian 6
I dont want that the user has access to the ssh key via sftp and ftp. Is there a way to change the directory or revoke the permissions, even to see the .ssh directory ? Have not found anything with google.
Im using debian 6
Because the authorized keys file needs to be read by the user that's login in, there is no way to prevent him/her from, at least, reading it.
However, you can place the public keys of authorized users in a custom path using the following directive:
AuthorizedKeysFile Specifies the file that contains the public keys that can be used for user authentication. AuthorizedKeysFile may contain tokens of the form %T which are substituted during connection setup. The following tokens are defined: %% is replaced by a literal ’%’, %h is replaced by the home directory of the user being authenticated, and %u is replaced by the username of that user. After expansion, AuthorizedKeysFile is taken to be an absolute path or one relative to the user’s home directory. The default is “.ssh/authorized_keys”.
So using something like:
AuthorizedKeysFile /some/path/authorized_keys/%u
will let you define a per-user file, in a controlled path outside users' $HOME
, with read-only permissions and possibly owned by root
.