# Restricting ftp users to html directory

**URL:** <https://forums.interworx.com/t/restricting-ftp-users-to-html-directory/17096>\
**Category:** General Discussion\
**Created:** [February 28, 2020, 6:05am UTC](https://forums.interworx.com/t/restricting-ftp-users-to-html-directory/17096 "2020-02-28T06:05:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bear](https://forums.interworx.com/letter_avatar_proxy/v4/letter/b/ac8455/32.png) [@bear](https://forums.interworx.com/u/bear)\
**Post date:** [February 28, 2020, 6:05am UTC](https://forums.interworx.com/t/restricting-ftp-users-to-html-directory/17096/1 "2020-02-28T06:05:11Z")

</div>

Hi  
Is there a way to setup new and existing siteworx accounts so when ftp is used they are restricted to html directory, a suppressing amount  
of users do not know what they are doing and end up either uploading to the wrong directory or deleting all the files in root.

Than you

---

<div class="post-metadata">

**Author:** ![d2d4j](https://forums.interworx.com/user_avatar/forums.interworx.com/d2d4j/32/16_2.png) [@d2d4j](https://forums.interworx.com/u/d2d4j)\
**Post date:** [March 2, 2020, 10:18am UTC](https://forums.interworx.com/t/restricting-ftp-users-to-html-directory/17096/2 "2020-03-02T10:18:18Z")

</div>

Hi Bear

Good question and I believe this can be achieved by adding additional lines in FTP config .

The exact lines I am not sure, but I changed ours to not allow executable files such as .exe or .com etc… to be uploaded or have a file already in their ftp folders renamed as executable

Many thanks

John

---

<div class="post-metadata">

**Author:** ![bear](https://forums.interworx.com/letter_avatar_proxy/v4/letter/b/ac8455/32.png) [@bear](https://forums.interworx.com/u/bear)\
**Post date:** [March 4, 2020, 6:36am UTC](https://forums.interworx.com/t/restricting-ftp-users-to-html-directory/17096/3 "2020-03-04T06:36:55Z")

</div>

I will have a search and find out, thank you

---

<div class="post-metadata">

**Author:** ![d2d4j](https://forums.interworx.com/user_avatar/forums.interworx.com/d2d4j/32/16_2.png) [@d2d4j](https://forums.interworx.com/u/d2d4j)\
**Post date:** [March 5, 2020, 10:24am UTC](https://forums.interworx.com/t/restricting-ftp-users-to-html-directory/17096/4 "2020-03-05T10:24:09Z")

</div>

Hi Bear

I think the following may help you

Many thanks

John

The syntax for the DefaultRoot directive is:

DefaultRoot DIRECTORY USER(S)

You can make DefaultRoot entries at the bottom of the proftpd.conf file.

Example 1: To restrict the user ‘myname’ to their home directory, you would make the following addition to the proftpd.conf file:

DefaultRoot ~ myname

The ~ represents the home directory of any user, so this would restrict the user myname to their home directory when in FTP.

Example 2 - To restrict the user myname to a vhost directory, the following entry could be made:

DefaultRoot /home/unixname/domain.url/html/ myname

You need to restart ProFTP when changed

---

<div class="post-metadata">

**Author:** ![bear](https://forums.interworx.com/letter_avatar_proxy/v4/letter/b/ac8455/32.png) [@bear](https://forums.interworx.com/u/bear)\
**Post date:** [March 13, 2020, 7:45am UTC](https://forums.interworx.com/t/restricting-ftp-users-to-html-directory/17096/5 "2020-03-13T07:45:59Z")

</div>

Sorry I missed your comment John, thank you for the information.

It seams quite easy to restrict individuals to a directory but I could not find a way to restrict all users of the server to html directory without listing every users in the proftpd.conf.
