Operating System - HP-UX
1833459 Members
3065 Online
110052 Solutions
New Discussion

Re: Chaning File Permission after FTPing

 
Shahbaz_1
Regular Advisor

Chaning File Permission after FTPing

Hi,
When I FTP a file from DOS to Unix (hpux 11i),
the file permission is -rw-r-----.
HOw should I change the file permissions, when FPTed?
Please ...

Thanks Regards
Syed
Let's share the great thing "THE KNOWLEDGE"
6 REPLIES 6
Bill McNAMARA_1
Honored Contributor

Re: Chaning File Permission after FTPing

this is a security feature of ftp.
you can't.

You can try to shell
!chmod $i

if you use a shell script to ftp for you

Later,
Bill
It works for me (tm)
Niraj Kumar Verma
Trusted Contributor

Re: Chaning File Permission after FTPing

Hi,

you can use a tool called CuteFtp and define the umask value (file permission)

If using unix you get a option

ftp> umask

will print the current umask value

--Niraj
Niraj.Verma@philips.com
Carlos Fernandez Riera
Honored Contributor

Re: Chaning File Permission after FTPing

You can change umask in ftpd daemon on HP-UX, but affect all ftp sessions.


You must configure /etc/inetd.conf.


Read man ftpd first.
unsupported
Steven Sim Kok Leong
Honored Contributor

Re: Chaning File Permission after FTPing

Hi,

You can change the default permissions by setting the umask in the ftpd options within your /etc/inetd.conf:

Example

ftp stream tcp nowait root /usr/lbin/ftpd ftpd -l -u 077 -t600

The umask of 077 allows only the permissions of eg. 600 (rw-------) for default system permissions of 666.

Hope this helps. Regards.

Steven Sim Kok Leong
Mohammad Iqbal_1
Occasional Advisor

Re: Chaning File Permission after FTPing

Hi..
I supposed we can dot that, but.. we can't change the file permission while FTP. But we can use umask command before we execute FTP.

Example:
I used umask command:
# umask u=rwx,g=,o=

Then i FTP to another host to get a file whose permission is different with my 'umask'.

Then when the FTP is close, i have the file with the permission similiar to my 'umask'.

Try this..!
Iqbal "the Captain"
David Burgess
Esteemed Contributor

Re: Chaning File Permission after FTPing

To get round the problem here we always send a file with the same name. We touch the file on the unix server and then chmod it to what it needs to be. Then everytime we send the file the permissions stay the same.

Dave.