LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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


Reply
  Search this Thread
Old 03-20-2007, 10:56 PM   #1
singhpps
LQ Newbie
 
Registered: Jan 2007
Posts: 3

Rep: Reputation: 0
Unhappy 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.
 
Old 03-28-2007, 06:54 AM   #2
fotoguy
Senior Member
 
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: Custom Debian Live ISO's
Posts: 1,291

Rep: Reputation: 62
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
 
Old 03-28-2007, 11:34 PM   #3
singhpps
LQ Newbie
 
Registered: Jan 2007
Posts: 3

Original Poster
Rep: Reputation: 0
Smile 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
 
Old 11-26-2010, 12:53 AM   #4
farooq.pathan
LQ Newbie
 
Registered: Mar 2010
Posts: 5

Rep: Reputation: 0
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
 
Old 11-27-2010, 11:06 AM   #5
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
Quote:
Originally Posted by farooq.pathan View Post
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!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Building a script to run after user login callingrohit Linux - General 4 04-26-2006 06:05 PM
How to run a Script as root, after Login as User, in GDM MHOOO Red Hat 14 03-08-2005 08:41 AM
Unable to login as local user with vsftpd running on the server kairamr Linux - Newbie 1 06-09-2004 02:25 PM
Where to run scripts automatically on login/logout hilltop*Tech Linux - General 2 02-06-2004 10:59 AM
How logout from login-menu bash script? MikHud Linux - General 0 04-12-2002 12:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration