Search code examples
sshsftp

Is it possible to restirct an ssh key to specific directories


I have an account on a server that I need to give sftp access to another person. This person however only needs access to a small subset of directories. Is it possible, without creating another user account, to restrict an ssh key to that subset of directories.

Basically the website on which these directories are located lives within the home directory of a specific user account. I would prefer not to have to create a separate user account just to lock the use down to those directories. If it is possible to lock down the access to specific directories using an ssh key that would be ideal.


Solution

  • It's possible, but it's sort of a hack. The much preferred, simpler way is just to only grant that user permissions to certain files and directories.