How to set FTP user permission to access a specific directory?

How to set FTP user permission to access a specific directory?

Either via command line or directly via virtualmin.
What do you want to do?

Via virtuamin
I want to create an FTP user with access to a selected directory - not to the entire server content

FTP users are by default locked to their home (website / virtual server) directory, is that what you want?
If yes, go to:
“Edit Users” -> “Add a website FTP access user” and fill in the details.
I am not sure, but I think virtualmin is able to let users go to other folders if set to. But like I said, I am not sure.
Otherwise you could just use the command line to create a new user and set your desired folder as home.

But i dont know how to set permission for specific folder.
User have permission for website - but i want to give only for folder.

By default the FTP user from a website has permissions for the public_html folder (website folder) and those permissions are recursive. Meaning that every folder and file within that main folder is allowed by default too.
Is that what you want or not? You should try to be a bit more specific.^^

Every user I create has access to all public_html content.
For example I have 3 directories
public_html/test
public_html/test1
public_html/test2
But I need to create a user who will only have access to the given directory public_html/test.
I’m setting the start directory to this location - but this does not decrease permissions and such user has access to the other directories test1 and test2.

If I recall it correctly, thats possible with Virtualmin natively.
Go to the vhost / virtual server and then select “Edit Users”. There you can set FTP accounts (Add a website FTP access user". If you add one, make sure to go the the tab / area “Quota and home directory settings”.
By default its set to: Main website directory
You should change it to: test1 (or however the folder is named)

That should lock the FTP user to the directory.

No, it doesn’t block access, it just sets the home directory for that user…

Make sure that in ProFTPD this line:

DefaultRoot

Is changed or is the following:

DefaultRoot ~

That will lock users into the home directory. You need to restart the proftpd after that.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.