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

how to FTP files with keeping access permission intact?

Status
Not open for further replies.

alan123

MIS
Oct 17, 2002
149
US
hi,

I have two linux server, I try to copy all files under cgi-bin folder from one to another, if I use ws_ftp to transfer files to local machine(windows) and ftp back to 2nd linux server, all file access permissions have been changed, is there a way I can ftp all sub-directories and files to 2nd linux server and keep the file access permission intact?

Thanks for your help.

michael
 
What FTP server are you using?

Also, depending on your needs, you may be able to fix this simply by adding the SGID bit to the upload folder and setting an appropriate umask value for uploaded files.

ChrisP
RHCE, LPIC-1, CCNA, CNE, MCSE, +10 others
 
ChrisP,

I use wu-ftpd on redhat 8.
Can you let me know how to "adding the SGID bit to the upload folder and setting an appropriate umask value for uploaded files"?

thanks
 
I don't use Wu-FTP. I would recommend using either ProFTPD or vsftpd.


Setting the SGID bit on a directory is simple. Just use something like this...

chmod 2770 /var/ftp/upload -R
chown root.users /var/ftp/upload -R

The 2 in the 2770 sets the SGID bit on the /var/ftp/upload folder. When this bit is set, any newly created files in this directory will be owned by whatever group owns the parent directory. In this case, any newly created files in the upload folder will automatically be owned by the users group.

A umask value sets the default permissions on uploaded files. For example, if you wanted all files to have 755 perms after being uploaded, you would set the umask bit to 022. Where you actually set this bit depends on the FTP server you are using.


ChrisP
RHCE, LPIC-1, CCNA, CNE, MCSE, +10 others
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top