Computing.Net > Forums > Unix > chmod after ftp a file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

chmod after ftp a file

Reply to Message Icon

Name: mehul
Date: February 6, 2003 at 16:24:09 Pacific
OS: sun5.8
CPU/Ram: sun
Comment:

Hi Need some help here with ftp
I am ftping a .TAR file of huge size on
different server...the tar file ftp'ed does
not have permission for others to untar it....
even though the file i am ftping have rwx
permissions after ftp it is changed to read only
for others...is there a way the permissions are
retained to rwx



Sponsored Link
Ads by Google

Response Number 1
Name: deeps
Date: February 7, 2003 at 03:36:59 Pacific
Reply:

it depends upon the umask set on the server where u are ftping the file too. If the umask is set something like 022 then even if you ftp the file with twx permission for others, it will make it read only.

You could check the umask by giving "umask" at prompt.


0

Response Number 2
Name: Jerry Lemieux
Date: February 7, 2003 at 07:05:05 Pacific
Reply:

The default umask for ftpd is 027 on most versions of unix. On linux, it is whatever the default umask for the system has been set to, as was explained above. When you connect to a system, you can see what the umask has been set to with the command "site umask" at the ftp prompt. Typing just umask will not work with some versions of unix but does work with linux. Not sure about Billyware (Windows). If you want to change the umask, type "site umask 000" or whatever you wish to change it to. Some versions of unix, such as AIX, allow the default umask to be set when the ftpd is started. With AIX, it is the -u option. Check you system documentation for the particular OS you are using.

Jerry


0

Response Number 3
Name: techy
Date: February 8, 2003 at 03:13:22 Pacific
Reply:

Changing the umask only affects new files that are created. You don’t need to do that. After FTPing the file use chmod to set the RWX permissions you want, i.e. chmod 755.
Also, don’t forget the owner will be whoever you logged on as in the FTP session, so if you did it as root no one else will be able to access it, use chown to set that.


0

Response Number 4
Name: Jerry Lemieux
Date: February 17, 2003 at 09:04:36 Pacific
Reply:

If I use the site command to change the umask prior to beginning my file transfer, how is that less effective than your proposal that the user do a chmod on all the files after the transfer? With the "site umask 000" command, I set the permissions on all the files I'm transferring. I can put the site command in a .netrc and forget about it. What is the benefit of a chmod after the transfer?

Also, please tell me what was wrong with my recommendation. I can hardly wait to get wisdom from a "Techy."

Jerry


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: chmod after ftp a file

FTP a file from NT to UNIX box www.computing.net/answers/unix/ftp-a-file-from-nt-to-unix-box/4191.html

ftp a pgp encripted file www.computing.net/answers/unix/ftp-a-pgp-encripted-file-/8173.html

how to replace a file and save it i www.computing.net/answers/unix/how-to-replace-a-file-and-save-it-i/7216.html