Operating System - HP-UX
1828798 Members
2444 Online
109985 Solutions
New Discussion

Problems with permissions on files when using ftp

 
SOLVED
Go to solution
Ginny Merlino
Advisor

Problems with permissions on files when using ftp

Hi,

When I transfer a file using ftp from my c:drive to unix, the file is getting the following permissions rw-r-- ---

the umask for the user that I am transfering to
is 000.

Is there a way to have the file permissions set to 666 when the file is transferred?

Thanks!
Ginny
5 REPLIES 5
James R. Ferguson
Acclaimed Contributor
Solution

Re: Problems with permissions on files when using ftp

Hi Ginny:

Yes, you can establish a 'umask' for the ftpd daemon process.

In '/etc/inetd.conf', add '-u 111' to the options for the 'ftpd' daemon. Then, restart 'inetd', thusly:

# /usr/sbin/inetd -c

Regards!

...JRF...
Jeff Schussele
Honored Contributor

Re: Problems with permissions on files when using ftp

Hi Ginny,

Yes you can.
You have to use the /etc/ftpd/ftpaccess file to do this.

Here's an example ftpaccess entry:

upload /home/user3 /systools/user3-ftp yes user5 sys 0666

Note how I can also change the default ownership of the file as well.
Also be advised that you have to change the ftp line in /etc/inetd.conf to read like:

ftp stream tcp nowait root /usr/lbin/ftpd ftpd -v -a

The key requirement is the -a parameter - tells inetd to use the ftpaccess file for ftp.

Do a man ftpaccess for further details - especially about the need for a class statement in that file.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Jeff Schussele
Honored Contributor

Re: Problems with permissions on files when using ftp

It should be noted that JRF's accurate method would be global to all users. Whereas the method I spelled out can be used to drill down to a specific user & directory.
You could have multiple entries in the ftpaccess file for mult users & even the same user with mult dirs.
Harder to initially setup, but infinitely more flexible.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Ginny Merlino
Advisor

Re: Problems with permissions on files when using ftp

Thanks for your help!

It worked fine!

Rgds,
Ginny
James R. Ferguson
Acclaimed Contributor

Re: Problems with permissions on files when using ftp

Hi (again) Ginny:

Yes, Jeff's choice is certainly the more restrictive and therefore more secure. The default 'umask' for the 'ftpd' daemon in the absence of any '-u ' specifiction is 027. You could tighten or loosen this slightly and then customize as Jeff suggested.

Regards!

...JRF...