Operating System - HP-UX
1836367 Members
2236 Online
110100 Solutions
New Discussion

ftp file and permisson setting

 
Kenn Chen_1
Advisor

ftp file and permisson setting

Hello.

I would like to ftp my files to UNIX server and set the file to permisson 777 automatically. As i knew, need to put the ftp entry (end of the line 000) in inetd.conf file. But it only can set the file permission to 666 not 777. Anywhere to set the file permission for ftp service ? Thanks.
6 REPLIES 6
Stefan Farrelly
Honored Contributor

Re: ftp file and permisson setting

Jdamian
Respected Contributor

Re: ftp file and permisson setting

It is not possible.

The default permissions for a file when it is created is 666. The default permissions for a directory when it is created is 777.
Stefan Farrelly
Honored Contributor

Re: ftp file and permisson setting

Cant with HP's ftp, but I believe you can by replacing with another ftp - eg. ProFTP, pureftpd, or wu_ftp. You can download from;

http://hpux.cs.utah.edu
Im from Palmerston North, New Zealand, but somehow ended up in London...
Lorenzo Facello
Valued Contributor

Re: ftp file and permisson setting

in etc/inetd.conf set umask:
ex.
ftp stream tcp nowait root /usr/lbin/ftpd ftpd -l -u017
(file will be -rw-rw----)
(dir will be drwxrw----)
becouse by default file's permission are
-rw-rw-rw-

or try to change umask at yours ftp session.
john korterman
Honored Contributor

Re: ftp file and permisson setting


Hi,
it requires that you ftp by "secure ftp". You have to configure the file /etc/ftpd/ftpaccess
and pay particular attention to the lines for configuring the file permissions for upload.

An example of a single configuration line concerning upload from a system with ftpaccess:
upload /home/sikker_ftp/haps /hapspr1dir yes mr dba 0777 dirs

and a file ftp'ed into the hapspr1dir:
# ls -l
total 2
-rwxrwxrwx 1 root dba 4 Sep 26 12:47 ftptest

It is an authentic example. However, it puzzles me that the file it owned by root - it should not, but at least the permissions are as requested.
Hope it helps.

regards,
John K.


it would be nice if you always got a second chance
Bill Hassell
Honored Contributor

Re: ftp file and permisson setting

Do you REALLY need 777 permissions? Remember that 777 means the files can be trashed by ANYONE on the computer and that EVERY file is executable (such as a script). An executable file is an exception which is why the default (not just ftp) is not executable. Depending on the server settings, you may be able to use the SITE CHMOD command to set specific capabilities. I would bw very careful about setting world-writable (even world-readable) capability on important files.


Bill Hassell, sysadmin