Quando você usa colocar em ftp , é o servidor que determina as permissões do arquivo enviado.
Supondo que você esteja usando o servidor FTP do Solaris (e não algum aplicativo de terceiros), as informações estão em ftpaccess (4) , que descreve /etc/ftpd/ftpaccess
Essas configurações são relevantes para os arquivos enviados (eles são independentes das permissões cliente ):
defumaskumask classSet the
umaskapplied to files created by the FTP server if the remote user is a member of the named class. If class is not specified, then use the umask as the default for classes that do not have one specified. The mode of files created may be specified by using theuploaddirective.
upload[absolute|relative] [class=classname]...[-]root-dir dirglob yes|no owner group mode [dirs|nodirs] [d_mode]Define a directory with dirglob that permits or denies uploads. If it does permit uploads, all newly created files is owned by owner and group and has their permissions set according to mode. Existing files that are overwritten retains their original ownership and permissions. Directories are matched on a best-match basis. For example:
upload /var/ftp * noupload /var/ftp /incoming yes ftp daemon 0666upload /var/ftp /incoming/gifs yes jlc guest 0600 nodirswould only allow uploads into
/incomingand/incoming/gifs. Files that were uploaded to/incomingare owned by ftp/daemon and have permissions of 0666. Files uploaded to/incoming/gifsare owned by jlc/guest and have permissions of 0600. The optionaldirsandnodirskeywords can be specified to allow or disallow the creation of new subdirectories using themkdircommand. If theuploadcommand is used, directory creation is allowed by default. To turn it off by default, you must specify a user, group and mode followed by thenodirskeyword as the first line where theuploadcommand is used in this file. If directories are permitted, the optional d_mode determines the permissions for a newly created directory. If d_mode is omitted, the permissions are inferred from mode. The permissions are 0777 if mode is also omitted. Theuploadkeyword only applies to users who have a home directory of root-dir. root-dir may be specified as * to match any home directory. The owner or group may each be specified as*, in which case any uploaded files or directories are created with the ownership of the directory in which they are created. The optional first parameter selects whether root-dir names are interpreted as absolute or relative to the current chroot'd environment. The default is to interpret root-dir names as absolute. You can specify any number ofclass=classname restrictions. If any are specified, thisuploadclause only takes effect if the current user is a member of one of the classes.In the absence of any matching
uploadclause, real and guest users can upload files and make directories, but anonymous users cannot. The mode of uploaded files is 0666. For created directories, the mode is 0777. Both modes are modified by the current umask setting.
Bastante prolixo, mas essencialmente dizendo:
- as permissões padrão dos arquivos enviados são mais frouxas do que as que você vê e
-
defumaskpermite ao administrador reduzir essas permissões globalmente e -
uploadpermite ao administrador ajustar as coisas.
Na prática, a maioria dos administradores provavelmente define defumask .
As permissões dos arquivos enviados não dependem da sua configuração umask no shell fora do cliente ftp . A página de manual do Solaris ftpaccess implica (consulte a seção sobre Recursos de Permissão ) que os clientes podem especificar um umask, mas seu cliente não lista isso como um comando.
Mesmo com as configurações documentadas, alguns administradores encontram peculiaridades, por exemplo,