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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ftp file creation perms (urgent) 1

Status
Not open for further replies.

cgswong

MIS
Nov 27, 2000
202
0
0
US
Hi all,

I need some help with an annoying problem I'm having. I'm trying to make any file that a user creates (especially files created via ftp) have the same permissions (rw for group and world especially) as that of the user/owner. The problem is, the files that come over via ftp using my ftp user get created with the permissions rw-r--r--

I have set the umask to 011 in the user's .profile so what am I missing? Please help, this is urgent.

Thanks and regards.

- Stu
 
No special client is being used. I've tried doing the ftp from Windows NT/2000 and Solaris and it still gives the same results.
 
are you using samba?

is that whats happening?
 
If I remember correctly ftp umask permissions are set in /etc/default/ftpd.. you'll probably need to create the file and add the line

UMASK=011

Unfortunately this is gonna apply to everyone using ftp :-( If anyone knows how to do this at a user level I too would love to know

Chris
 
i had a look, and i think it applies to everyone, and there is no way out ...

the ftpd seems to check permissions to write, then creates the files and chown's them ... so the umask has to be universal ...

you could of course make /etc/ftpusers a very small subset of users ...
 
Hmmm -- doesn't /etc/ftpusers *exclude* that list of users from using ftp into that machine? Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
yeah ... but a simple nawk script'll fill it in for you from passwd :)
 
Thanks, for all the input guys. I think I'll set the umask in /etc/default/ftpd with the /etc/ftp.deny (or /etc/ftpusers) setup. I've got a limited list of ftp users anyways. I guess that's all I can do for now.

Regards.
 
I have the same problems.
When a user ftps a file over, it has the permission rw-r--r-- set. I am using proftpd on suse linux. The Umask setting removes rights form the file, there is no way to add rights to the file. I am looking for the way to set the default permissions for a file a user creates so the files wil be available for someone acessing the website through the apache server. Please help, I cannot find the way to set the default permissions for a file created by a user... The files need more rights to be able to be viewed by website vistors. If I upload a html with a lot of image files, I have to chmod them manually, which is a lot of unnessasary extra work .
Arjen.
 
Have you looked in /etc/default/ftpd ? Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
Have all you tried the [tt]chmod[/tt] or [tt]site chmod[/tt] command of FTP. You can not set a default individual umask for users, but you can teach'em to use the chmod command to reset the mode bits.

I hope it works...
Unix was made by and for smart people.
 
I just wanted to add that inetd.conf needs to be edited also. Add the following to the end of the ftp line. -uxxx
i.e.
ftp stream tcp nowait root /usr/lbin/ftpd ftpd -l -uxxx
(xxx = umask)

Once you save this, type the following at the prompt.

inetd -c

(this reinitializes the inetd service)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top