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

file access permissions on unix after ftp from PC 2

Status
Not open for further replies.

jboo

Programmer
Jan 4, 2001
12
GB
Having done ftp from a PC to a unix box,i.e. "put" from PC (local) to unix (remote), the file's access permissions are rw- (owner), r-- (group) and --- (other). Is there any way within the ftp session I can change these?
 
No, you can't change the file permissions via ftp. These permissions are controlled by the value of umask.

I can't remember where this is set for files created via ftp, but it could be in /etc/profile. Someone else should be along shortly who will know this.

Greg.
 
Here is your answer.......

Yes, umask is what controls file permissions for copied files but not the user's umask. The ftp daemon's umask is what you need to alter.......

In AIX:

/etc/inet.inf file contains a list of subsystems to start at startup by the inet daemon. ftp is one listed here.
You have to add a switch to the ftpd command ( example: ftpd -u 022) at the end of the line where it is defined. Then, stopsrc -t ftp to bring down ftp and, startsrc -t ftp to bring it back up. thats' it !!

- mitchy martell ( famous french race car driver)
 
Will this solution also work for Solaris 5.7 ??
 
Sirrom.

For Solaris create (if doesn't exist), the file "/etc/default/ftpd" and put
UMASK=xxx

where xxx is the mask you want for ftp connections, with this file you can also control other things you can check
man page fir "ftpd"

Regards,

Carlos Almeida,


 
Hi,
I have a similar problem. I want to upload a file to my server from Windows. I have the userid/pwd. I want to automate the process. Something like, i will click on a batch file which should ask me for a password. When i supply a valid password it should upload the file. The file name and the source directory are assumed to be non changing and fixed and known.Is such a thing possible???
I achieved until this:I created a batch file. In that only i have hardcoded username and pwd.

ftpBatch.bat
=============
cd c:
ftp -s:%0
goto done
open xxx.xxx.xxx.xxx(IP add)
user
pwd
cd DESTINATION_DIR
mput file1.txt
y
bye
:done
========================
Instead of hardcoding i want it to be atleast a command line parameter which can be run using:
C:\> ftpBatch.bat pwd

Any inputs will be highly appriciated....

Thanks and Regards,
Srinath Thanks and Warm Regards,
Srinath M.K
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top