Frequent Question: How Do I Restrict Sftp Users Home Directory in Linux?
Contents

The simplest way to do this, is to create a chrooted jail environment for SFTP access. This method is same for all Unix/Linux operating systems. Using chrooted environment, we can restrict users either to their home directory or to a specific directory.

How do I restrict SFTP users home directory?

Restrict SFTP User Access to Specific Directories in Linux

  1. Install OpenSSH Server. In order to be able to configure restricted directory access for SFTP users, ensure that OpenSSH server is installed. …
  2. Create Unprivileged SFTP User Account. …
  3. Restrict SFTP User Access to Directory with Chroot Jail. …
  4. Verifying SFTP User Restricted Directory Access. …
  5. Related Tutorials.

16 мар. 2020 г.

How do I restrict users to my home directory in Linux?

  1. Login as the root user. Type any one of the following command: …
  2. Create the chroot jail. I’m going to set /home/jails/ directory to restrict an ssh user session to this directory: …
  3. Set permissions. …
  4. Install bash shell in $D. …
  5. Add user to the the system. …
  6. Configure sshd. …
  7. Restart sshd service. …
  8. Test it.
Sophia Al-Mansoor

Sophia Al-Mansoor

Global Business & E-Commerce Reporter

Sophia analyzes international trade, startup ecosystems, retail transformation, and supply chain logistics for modern digital publications.

Share this article
Twitter Facebook Pinterest