Script run as user login or logout in Vsftpd server
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Script run as user login or logout in Vsftpd server
Hi
I want to make changes in my vsftpd server so that user can upload their files but cant delete. change ownership configuration is there but that is only for one owner. in my scenario there are more than one owner for different directories. can anyone guide me how to make a script executable when user login or if any user logout from vsftpd server. so that i can run the script to change the owner. setuid bit is not working on directory in Linux red hat. Please help me.
I would add the vsftp users to their own group, then add a line in the /etc/profile file to run commands when they log in. Say for example you create a group called vsftpuser and has a group id number of 110, you could write something like this:
if [ $UID = "110" ]; then
then do something here
fi
As for logging out I'm not sure how to do that, never had any need for it in the past
I have done that in different way mentioned below:-
FTP Server Delete Restriction Settings User Bases
In this scenario we have two users test1 and test2
We will revoke deletion rights from user test2
Add an entry in Vsftpd.conf “user_config_dir=/etc/vsftpd/users/”
Create file in /etc/vsftpd /users/ by the name of User in this case it is test2
Add this in the file test2 :-
cmds_allowed=ABOR,CWD,LIST,MDTM,MKD,NLST,PASS,PASV,PORT,PWD,QUIT,RETR,RMD,RNFR,RNTO,SIZE,STOR,TYPE,U SER,ACCT,APPE,CDUP,HELP,MODE,NOOP,REIN,STAT,STOU,STRU,SYST
6. Restart the service
7. From now Test2 can upload files but can’t delete but Test1 can do the both
8. This is tested on vsftpd server 2.0 centos 4.4 linux
#
# ABOR - abort a file transfer
# CWD - change working directory
# DELE - delete a remote file
# LIST - list remote files
# MDTM - return the modification time of a file
# MKD - make a remote directory
# NLST - name list of remote directory
# PASS - send password
# PASV - enter passive mode
# PORT - open a data port
# PWD - print working directory
# QUIT - terminate the connection
# RETR - retrieve a remote file
# RMD - remove a remote directory
# RNFR - rename from
# RNTO - rename to
# SITE - site-specific commands
# SIZE - return the size of a file
# STOR - store a file on the remote host
# TYPE - set transfer type
# USER - send username
#
# less common commands:
# ACCT* - send account information
# APPE - append to a remote file
# CDUP - CWD to the parent of the current directory
# HELP - return help on using the server
# MODE - set transfer mode
# NOOP - do nothing
# REIN* - reinitialize the connection
# STAT - return server status
# STOU - store a file uniquely
# STRU - set file transfer structure
# SYST - return system type
Is there anyway we can run some script for example copy script which would copy the uploaded data to another folder after successful upload.
Help appreciated.
Thanks
Hi farooq,
technically this is a hijack - you posted your question onto someone else's thread. Not to mention, a 3 year old thread.
Over here: http://www.linuxquestions.org/questi...upload-846904/
I have pruned your question off of another of your threads and given it a thread of its own. And while the "Server" forum is an OK place for the question, you might decide you would prefer to have posted it in the "Programming" forum, since you are after all asking for help with a script. If you would like the thread moved to "Programming", just click the REPORT button on the first post in the thread, and ask a moderator to move it for you.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.