Operating System - HP-UX
1820160 Members
2812 Online
109620 Solutions
New Discussion юеВ

Files being created with incorrect permissions

 
Simon R Wootton
Regular Advisor

Files being created with incorrect permissions

We have files being copied (via ftp) from one machine to another. On the destination machine, the files are being created with the wrong permissions.

I need to know a) why this is happening b) how to cure it

All help rewarded, thanks in advance.
Simon
6 REPLIES 6
V.Tamilvanan
Honored Contributor

Re: Files being created with incorrect permissions

Hi,

FTP doesn't copy the attributes. It put the permission based on your umask setting at the Local Directory.
See man umask and ftp.
Robert-Jan Goossens
Honored Contributor

Re: Files being created with incorrect permissions

Hi Simon,

Check this thread.

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=555929

Hope this helps,
Robert-Jan
twang
Honored Contributor

Re: Files being created with incorrect permissions

2 things you have to check,
- In the ftp line of /etc/inetd.conf, take a look at parm on the ftpd command
ftp stream tcp nowait root /usr/lbin/ftpd ftpd -l -u 022
(-u xxx where xxx=umask default is 027)
- In /etc/ftpd/ftpaccess there may be a line that looks like
upload /home/user /path/to/upload/dir yes user group 0666

SANTOSH S. MHASKAR
Trusted Contributor

Re: Files being created with incorrect permissions

Hi Simon,

ftp doesnot preserve file permissions, it
takes permission as per umask setting. If u
need to preserve file permissions user rcp -p command. See man pages of rcp for details.

Regards.

-Santosh
Cheryl Griffin
Honored Contributor

Re: Files being created with incorrect permissions

Also, umask can not add to permissions that are not already there, meaning that if the file is only read-write, umask cannot add the executable bit.
"Downtime is a Crime."
doug mielke
Respected Contributor

Re: Files being created with incorrect permissions

If you choose rcp -p, remember that the user ID's need to match between systems, since it's the user and group id's that are passed, not user names.