Linux - Software This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
03-20-2007, 10:56 PM
|
#1
|
LQ Newbie
Registered: Jan 2007
Posts: 3
Rep:
|
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.
Last edited by singhpps; 03-20-2007 at 11:28 PM.
|
|
|
03-28-2007, 06:54 AM
|
#2
|
Senior Member
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: Custom Debian Live ISO's
Posts: 1,291
Rep:
|
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
|
|
|
03-28-2007, 11:34 PM
|
#3
|
LQ Newbie
Registered: Jan 2007
Posts: 3
Original Poster
Rep:
|
Hi thanks a lot for your reply
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
Prepared and tested by:
Pritpal Singh
|
|
|
11-26-2010, 12:53 AM
|
#4
|
LQ Newbie
Registered: Mar 2010
Posts: 5
Rep:
|
Thanks for the help.
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
|
|
|
11-27-2010, 11:06 AM
|
#5
|
LQ Guru
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594
|
Quote:
Originally Posted by farooq.pathan
Thanks for the help.
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.
Cheers!
|
|
|
All times are GMT -5. The time now is 06:36 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|