1833874 Members
2393 Online
110063 Solutions
New Discussion

Re: FTP umask

 
Shahril M
Frequent Advisor

FTP umask

Hi folks,

Reading the various posts on this topic, I have learnt to get most of what I want set up done.

However, one thing remains unsolved; appreciate all assistance.

My user will ftp a folder which contains subfolders and files using a GUI-based ftp software. It recursively transfers the files and folders but only the files take the permission setting spelled out in the ftpaccess file. The folders (directories) remain at 750.

How do I get the directories' perms set up as I want?


Rgds,
Shahril
13 REPLIES 13
Jean-Louis Phelix
Honored Contributor

Re: FTP umask

Hi,

Which mask are you using ?

Regards.
It works for me (© Bill McNAMARA ...)
Shahril M
Frequent Advisor

Re: FTP umask

This is how my ftpaccess file looks like:

class all real,guest,anonymous *

upload / /ixos/extr3/ext_dir yes root sys 0666
upload /home/isdsbm /ixos/extr3/ext_dir/* yes root sys 0777 dirs

I ftp'd using isdsbm

My files become 777, but dirs are still 750


Rgds,
Shahril
Alexander M. Ermes
Honored Contributor

Re: FTP umask

Hi there.
Have you checked yout /etc/inetd.conf ?
This file has the basic parameters for the ftp daemon..

sample :

ftp stream tcp nowait root /usr/lbin/ftpd ftpd -l -u 022 -i -o -B1
024

If you change the u - parameter, your basic setup for fiel attributes should change as well.
Rgds
Alexander M. Ermes
.. and all these memories are going to vanish like tears in the rain! final words from Rutger Hauer in "Blade Runner"
Bernhard Mueller
Honored Contributor

Re: FTP umask

Sharil,

you could allow umask in the ftpaccess and have the user run "umask 000" (which would hopefully be possible in the GUI of the ftp client). Guess that would be the best solution.

Alternatively you can enable chmod, but then it would have to be done for each subdirectory, which is not a good solution.

If that user is the only one doing ftp to this machine you could also change the default umask for ftp in /etc/inetd.conf and re-reading inetd configuration by running inetd -c (Would not recommend that, though)
Any mkdir via ftp would then create a dir with permissions 777.

If all ftp-ed files end up in a certain directory, you could also run a daemon script that changes permissions to 777 whenever there is a directory with other permissions.

Regards,
Bernhard
Shahril M
Frequent Advisor

Re: FTP umask

Hi Alex,

IIRC, the -u option in inetd.conf changes the default umask for all ftps. If so, that is not what I want.

Bernhard,
I tried running umask command from the FTP client, but it did not seem to work. Is there a way to enable it via the ftpaccess file?

I agree that your 2nd and 3rd suggestions are not ideal. However, I did think about the 4th one (a cronjob to chmod), but it is not neat enough although perhaps my last resort. And it is not foolproof as the cron interval must not be too frequent yet not too far apart that the job the processes the files runs before the chmod takes place.


Rgds,
Shahril


Bernhard Mueller
Honored Contributor

Re: FTP umask

Sharil,

I believe you could just add
umask yes guest,real,anonymous

to your ftpaccess file to allow all clients the umask command.

Regards,
Bernhard
Shahril M
Frequent Advisor

Re: FTP umask

Hi Bernhard,

I will try that, and report how it turns out.

However, if I read the man page correctly, that umask and other options are granted by default.


Rgds,
Shahril
Shahril M
Frequent Advisor

Re: FTP umask

Hi,

Report: Still unsolved.

I am using the FTP Explorer from Hummingbird Exceed. Does anyone know of a graphical Windows-based FTP client that allows the user to issue a umask command?

The FTP Explorer has a feature to issue an arbitrary ftp command, but the umask command does not seem to work.

Appreciate all assistance, thx.

Shahril
李洪宇
New Member

Re: FTP umask

I have added the -u 022 option in the /etc/inetd.conf,and inetd -c,but it seem's not works yet?

# ftp stream tcp nowait root /usr/lbin/ftpd ftpd -l -u 002

Then restart 'inetd' with:

# /usr/sbin/inetd -c

Any one have further suggestions ?Thanks.
Mauro Gatti
Valued Contributor

Re: FTP umask

In my system I use ftpaccess in the follow way:

User: Alfa
Home: dir /home/alfa

If I want Alfa puts some files in /beta and these files must have owner alfa group users and permission 0666:

upload /home/alfa /beta yes alfa users 0666

Remeber to define at the head of ftpaccess rules to access to your ftp site:
class local real,guest,anonymous *.domain 0.0.0.0
class remote real,guest,anonymous *


Bye
Ubi maior, minor cessat!
G. Vrijhoeven
Honored Contributor

Re: FTP umask

Hi Shahril,

Besides the umask on the ftpdeamon there is a possebility to do an
chmod mode file-name
Change the permission modes of the file file-name on the remote
system to mode.
FTP understands this and if allowed ( rights) and if known by the interface you could try this.

HTH,

Gideon
Mauro Gatti
Valued Contributor

Re: FTP umask

Using WS_FTP client for windows You can issue a connda to remote ftp site like is writte in help:

Issuing Commands to an FTP Site

1 Select the site.

2 Select Properties.

3 Click the Startup tab.

4 In the Initialization command text box, enter any commands you want to issue to the FTP site at the beginning of the session. Separate multiple commands with a semi-colon (;).

For example, the command SITE UMASK 022 changes the UMASK used when creating files (on a UNIX system).


Rgds


Mauro
Ubi maior, minor cessat!
Michael Resnick
Advisor

Re: FTP umask

Just a note -

Hummingbird FTP does allow you to send a umask command but you have to do it as follows:

1) Select File, then Send Arbitrary FTP Protocol Command...

2) The command is formatted like
site umask 022

HTH,

Mike Resnick