Operating System - HP-UX
1825161 Members
2333 Online
109679 Solutions
New Discussion юеВ

set a default ftp umask by specific user

 
j773303
Super Advisor

set a default ftp umask by specific user

I've a question about how to set a default ftp umask by specific user, below is
======================================
/etc/ftp/ftpaccess
class all real,guest,anonymours *
guestgroup users
======================================

And I look document mentioned about below solution. Does anyone can tell me what's "classA" ?

=============================================
defumask umask [class]
defumask 0177
defumask 0133 classA

This creates files with the permission -rw-r--r-- for a user of ClassA. For other user, files are created with te permission -rw------
==============================================
Hero
11 REPLIES 11
Steven E. Protter
Exalted Contributor

Re: set a default ftp umask by specific user

Shalom,

To control permissions for an individual user, add more lines to the ftpacess file.

defumask 0133 newuser

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
j773303
Super Advisor

Re: set a default ftp umask by specific user

"defumask 0133 newuser" not workable.
the umask still not chaged.

Do you have any idea ?

Thanks in advaced.

Hero
Steven Schweda
Honored Contributor

Re: set a default ftp umask by specific user

According to "man ftpaccess", the "defumask"
directive takes an optional "class" argument,
not an optional "username" argument. I'd
guess that you need to define a "class" which
includes the user (or users) for which you
wish to set the default umask. "man
ftpaccess" also describes the "class"
directive which does this. For example (not
tested, but plausible):

class class_name real newuser
defumask 0133 class_name

The first defines a class, "class_name",
which comprises the real user, "newuser", and
the second sets the default umask for every
user in that class to "0133".

In the example you showed, the class name was
"classA", but we did not see where that class
was defined.
j773303
Super Advisor

Re: set a default ftp umask by specific user

I've configure as below, but umask seems still not workable. Could you please advise me any idea ? Thanks.


/etc/ftpd/ftpaccess
class classA real,guest,anonymous *
guestgroup users

defumask 0123 classA
Hero
Steven Schweda
Honored Contributor

Re: set a default ftp umask by specific user

> guestgroup users

Are you changing other things to cause more
confusion, or what?

Otherwise, it looks ok to me. You might look
at /etc/inetd.conf to see how the ftpd is
being run. "man ftpd" says things like:

-a Enables the use of the configuration file
/etc/ftpd/ftpaccess. (See ftpaccess(4)).

-A Disables the use of the configuration file
/etc/ftpd/ftpaccess. (See ftpaccess(4)).

From that, it's not clear to me what the
default is, or whether you need to add "-a".
j773303
Super Advisor

Re: set a default ftp umask by specific user

It still can not umask successfully.
Following are the settings, OS 11.11, Can you advise me what's should I correct ? Thanks.

notes: I using "user1" from ftp

/etc/ftpd/ftpaccess
class classA real,guest,anonymous *
guestgroup users

defumask 444 classA


/etc/group
users::20:root,user1

/etc/inetd.conf
ftp stream tcp nowait root /usr/lbin/ftpd ftpd -l -a

Hero
j773303
Super Advisor

Re: set a default ftp umask by specific user

I'm try it successful in HPUX 11.23.
But failed with HPUX 11.11
I'm looking at PATCH problem.

Thanks.
Hero
j773303
Super Advisor

Re: set a default ftp umask by specific user

Dear Expert,
When I config ftpaccess as follows:
when user1 ftp, can get the 0433 umask.
However, user2 also 0433.

But I just want to user1 has 0433 umask, others are 0177. How to configure it ?

========================================
class classA real,guext,anonymous *

defumask 0177
defumask 0433 classA
========================================
Hero
Steven Schweda
Honored Contributor

Re: set a default ftp umask by specific user

> class classA real,guext,anonymous *

This puts all users ("*") of any type
("real,guest,anonymous") into the class
"classA". (Or it would, if you spelled
"guest" correctly.)

If you want only one user ("user1") in that
class, try defining it like this, instead:

class classA real user1

> others are 0177

"defumask 0177" should do that.
j773303
Super Advisor

Re: set a default ftp umask by specific user

But when I confiure as below, the the user will login failed with ftp? Is it ok in your environment ? class classA real user1

==============================
/etc/ftpd/ftpaccess
class classA real user1
defumask 0177
Hero
j773303
Super Advisor

Re: set a default ftp umask by specific user

I've install the lastest ftp patch for HPUX 11.23. But it still doesn't work configure ftp umask for individual user.
Does anyone has any suggestion are welcome ?
Thanks in advanced.
Hero