Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FTP Server deny mkdir directory creation 1

Status
Not open for further replies.

woter324

Technical User
Jan 26, 2007
179
GB
Hi All,

I've setup a vsftp server on FC 11 and would like to stop a paticular local FTP user creating directories.

We have disabled anonymous access (anonymous_enable=NO), therefore anon_mkdir_write_enable is irrelevent.

The user needs to be able to upload files therefore I don't see how setting file permissions would work.

I thought of disabling the mkdir command for that user, but how?

I am sure there must be an easier way, but I can't think of it.

Any help would be greatly apreciated.

Many thanks

Woter
 
The cmds_allowed option seems to allow you to turn off specific FTP commands, but I'm not sure how you'd do this for a specific user. The version I'm looking at (1.2.1) doesn't seem to be capable of user-specific configurations.

Annihilannic.
 
You could however run a second FTP server on a non-standard port for this user, using a separate configuration...

Annihilannic.
 
Thank you Annihilannic. I will investigate the cmds_allow setting. I think it's more important to stop any user creating directories, but it would be interesting to see if anyone comes up with any other method apart from port changing.

thanks again for your help.
 
Sussed it.

As Annihilannic pointed out, one can set the allowed and disallowed commands:
file: vsftpd.conf


Code:
# Allowed commands
# cmds_allowed=ABOR,ACCT,ALLO,APPE,CDUP,CWD,DELE,EPRT,EPSV,FEAT,HELP,LIST,MDTM,MODE,NLST,NOOP,OPTS,PASS,PASV,PORT,PWD,QUIT,REIN,REST,RETR,RMD,RNFR,RNTO,SITE,SIZE,SMNT,STAT,STOR,STOU,STRU,SYST,TYPE,USER,XCUP,XCWD,XPWD,XRMD
#
# Explicitly denied commands
# cmds_denied=MKD,MKDIR,XMKD
(If you paste this, make sure each directive is on one line.) The cmds_denied directive only works for vsftpd version 2.1.0

Reading though vsftpd FAQ

I found the user_config_dir directive. So I removed the above code from vsftpd.conf and added the line:


Code:
# Per user configuration
user_config_dir=/etc/vsftpd/user_conf
Created the directory as in the directive, copied the vsftpd.conf to the new directory, renaming to the ftp user name and added the cmds_allow/deny directive.

Now works a treat.

Many thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top