1830250 Members
2809 Online
110000 Solutions
New Discussion

ftp file permission

 
SOLVED
Go to solution
Dave Bunting
Frequent Advisor

ftp file permission

how do i set a permanent permission of 777 for my ftp'd files.. i always have to chmod all files i have uploaded everytime i do ftp...
3 REPLIES 3
Mary Ann Lipa
Valued Contributor
Solution

Re: ftp file permission

Hi Dave,
First edit your inetd.conf file
change ftpd entries to
ftpd -u 000
000 will give you permission 666, that's the maximum permission you could give to uploaded files via ftp.
Second, reread you inetd.conf file [inetd -c]

then try ftp'ing again.. observe... happy ftp'ing...
rgds,
Dan
Which is worse, smoking or picking your nose in a public place?
Patrick Wallek
Honored Contributor

Re: ftp file permission

You can't set a file to a permission of 777 unless you do it manuall. Files, by default, are given a permission of 666 (-rw-rw-rw-). If you have a umask set then the umask is subtracted from the default permission. If you get files with a permission of -rw-r----- then your umask is set to 026.

If you really want the files that are ftp to have wide open permissions, you'll have to modify the ftp line so that it reads:

ftp stream tcp nowait root /usr/lbin/ftpd ftpd -l -u 000

and you will get files with -rw-rw-rw-

From there you could write a script to check the directory every few minutes and do a chmod 777 /whatever/directory/* to make the files as you want.
Animesh Chakraborty
Honored Contributor

Re: ftp file permission

hi,
1) You can make the change globally for the ftp service by editing
the /etc/inetd.conf file:

ftp stream tcp nowait root /usr/lbin/ftpd ftpd -l -uxxx
Note: Where xxx would be the umask that you select.

After any change to the /etc/inetd.conf file, inetd must
re-read the new inetd.conf file:

inetd -c <-- make inetd re-read the inetd.conf file.

-OR-

2) Use the umask command while the ftp session is active. This will
only affect the current session for the user connection.

ftp> umask # current mask
200 Current UMASK is 777

ftp> umask 027 # change to new mask
200 UMASK set to 027 (was 777)

ftp> umask # verify new mask
200 Current UMASK is 027


Best of luck
Animesh

Did you take a backup?