How do I change my permissions when I FTP a file?
The way to set these permissions is to set the umask. The umask
must be set in one of two places depending on the sub-command that
is used. Those two subcommands are PUT and GET.
The PUT subcommand has a maximum permission of 644 which is a umask of
000. To set the umask for setting permissions via a PUT subcommand,
it is necessary to place a '-u xxx' flag at the end of this
statement in /etc/inetd.conf:
ftp stream tcp nowait root /etc/ftpd ftpd -u xxx
where xxx is the umask number that you decide to use. This umask must
be set on the machine that you want transfer the file to. So for
example if you want to transfer a file from machine A to machine B,
machine B must have this umask flag in its /etc/inetd.conf file.
The GET subcommand has a maximum permission of 666 which is still a umask
of 000. This is just how the FTP is set up. The GET subcommand checks
the environment umask. To see what the environment umask is just type
in 'umask'. To set the environment umask type in 'umask xxx', where
xxx is the umask numbers. This must be done on the machine that is
executing the GET subcommand. The GET subcommand does not pay
any attention the umask flag in the /etc/inetd.conf file.
The permissions for FTP files is calculated by taking 644 for the PUT
subcommand and 666 for the GET subcommand and subtracting it from
the umask. Therefore if the umask is 022 then the permissions for
a file transfered by the GET subcommand is 666-022 = 644. If the
environment umask is 222 then the PUT subcommand gives 644-222 = 422
for permissions for that file transfered.
The environment umask is set by typing 'umask xxx' where xxx is
the umask number. This is only set for the user who entered in
this command. You can set this environment variable permanently
for a user through smit. Just type in the following:
- type in user name
- set 'File creation umask' to desired umask
WARNING: Changing the environment umask not only changes permissions
on files that are FTPed, but also on any files or directories
that you create. Changing umask through smit means that this
is the umask you will use every time you login. Changing the
umask on the command line ends when you logout.
Support Line: FTP permissions ITEM: I0464L
Dated: April 1994 Category: N/A
This HTML file was generated 99/06/24~13:30:46
Comments or suggestions?