Can I create an SSH user which can access only certain directory?
Posted
by
RiMMER
on Super User
See other posts from Super User
or by RiMMER
Published on 2011-06-18T22:06:14Z
Indexed on
2011/06/21
16:25 UTC
Read the original article
Hit count: 325
I have a Virtual Private Server which I can connect to using SSH with my root account, being able to execute any linux command and access all the disk area, obviously.
I would like to create another user account, which would be able to access this server using SSH too, but only to a certain directory, for example /var/www/example.com/
For example, imagine this user has a HUGE error.log file (500 MB) located in /var/www/example.com/logs/error.log
When accessing this file using FTP, this user needs to download 500 MB to view the last lines of the log, but I'd like him to be able to execute something like this:
tail error.log
Therefore I need him to be able to access the server using SSH, but I don't want to grant him access to all server areas.
How can I do this?
© Super User or respective owner