Question

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

Posted June 21, 2017 1.5k views
Linux BasicsServer OptimizationSecurityUbuntu 16.04

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.

Submit an answer

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