Operating System - HP-UX
1834149 Members
2244 Online
110064 Solutions
New Discussion

file permissions after ftp

 
SOLVED
Go to solution
Animesh Chakraborty
Honored Contributor

file permissions after ftp

Hi All,
While doing ftp to transfer a file,the permission of the file gets changed.
Is there any way to keep the same permission
as of the source file ?
Thanks
Animesh
Did you take a backup?
4 REPLIES 4
James R. Ferguson
Acclaimed Contributor

Re: file permissions after ftp

Hi:

If a "copy" of the source file exists at the destination then the ownerships and permissions will be that of the "copy". In some situations it is possible to create an empty (null) file with the desired permissions and then replace it via ftp.

In other situations you might use 'rcp -p' to remotely copy and preserve permissions.

...JRF...
Vincenzo Restuccia
Honored Contributor

Re: file permissions after ftp

#tar cv ftp.tar /path/*
#ftp ....
#tar xv ftp.tar
Rita C Workman
Honored Contributor

Re: file permissions after ftp

ftp is part of the ARPA commands and as such does not in and of itself carry owner/permissions of the file to it's new location (with the exception that Jim mentioned). The ARPA commands are older and don't have some of the options that BERKLEY commands do.
For more flexibility in transferring files you may want to use the rcp command, which is part of the BERKLEY commands. By using the rcp -p option you maintain owner/permissions with the file. Just remember to use the 'r' commands you need to set up for remote connection (.rhosts).

Regards,
/rcw
Alexander M. Ermes
Honored Contributor
Solution

Re: file permissions after ftp

Hi there.
If you want changed permissions after the transfer, config this line in the /etc/inetd.conf :

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

RGds
Alexander M. Ermes
.. and all these memories are going to vanish like tears in the rain! final words from Rutger Hauer in "Blade Runner"