Report this

What is the reason for this report?

How can i restrict a user to their own home directory? [ROOT]

Posted on June 21, 2017

Hi, I am fairly new to linux administration and I’ve seen some of the posts on how to force users to their own home directory, I’ve tried several and got locked out of my own server… I decided it’d be better to make a new post.

Some goals:

  1. I use root to do every other thing (SSH and SFTP mostly)
  2. I’m trying to chroot users to their own directory eg: user test should be restricted to viewing only in home/test/ and cannot view out of it.
  3. SSH access & SFTP access should be allowed for the user test

A Huge thank you in advance.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.