home directory
Hi all! I want another home directory mask (for example 755). How I can change this mask during adduser operation? Thanks for advises. Nina.
Hellorghhh !!!
Le Lundi 3 Juin 2002 11:56, Кузнецова Нина a ?crit :
Quoted 4 lines
Hi all! I want another home directory mask (for example 755). How I can change this mask during adduser operation? Thanks for advises. Nina.
Well, er....
I'd try:
#umask
022 // Oh!!! This is my default mask...
#umask 027 // set your new mask, for 750 on directories.
#adduser XXXXXXXXXXX // now add users !!!
#adduser XXXXXXXXXXX
#adduser XXXXXXXXXXX
#......
#umask 022 // Back to your default mask
I looked for an option of adduser to do this, but it seems that there's no...
@++
Signature · 8 lines
( °> Nicolas Costes //\\ IUT de La Roche / Yon / \/ ) [email protected] `-<< http://luxregina.free.fr - To unsubscribe from this list: send the line "unsubscribe linux-admin" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): [email protected]
Le Mardi 4 Juin 2002 10:14, nina a ?crit :
Quoted 4 lines
Thanks for advise, I am knew about umask command, but how I can change home mask during adduser operation? Regards, Nina.
Hello, Nina .
Well, I think I didn't understand your whole question :-(
You said you want to change the home mask during "adduser", does that mean that you want the home directories to be created with a specific mask ? e.g., all those directories will have permissions set to '750' (for a umask set to '027'), while your usual mask is '022' .... I am right ??? If you want such a behaviour, well, the 'adduser' command doesn't seem to have an option to achieve that...
So, i can see 3 solutions:
- Use 'umask xxx' before and after 'adduser', like in my last mail.
- Use 'adduser -k TEMPLATE', where template is a skeleton of the users's future directory, with right permissions set... But I think this solution won't work, because permissions may be inherited from the upper directory during the copy... Have a try :-)
- Create your users, their home, and then use 'chmod' command recursively to change the directories permissions (Make a script).
If lost in the middle of the pinguin, try 'man umask', 'man adduser' (Already done it ? Sorry.)
I think I read that you are new to 'umask' (New to Linux ?)... If not, well, sorry !!! But don't mind to ask me more details, I'll help you. And don't mind too to give me more details :-)
@+++
Signature · 8 lines
( œ> Nicolas Costes //\\ IUT de La Roche / Yon / \/ ) [email protected] `-<< http://luxregina.free.fr - To unsubscribe from this list: send the line "unsubscribe linux-admin" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
On Tue, Jun 04, 2002 at 11:25:53AM +0200, Nicolas Costes wrote:
[...]
It depends which version of adduser in use. If it is script it can be easy modified according to admin wishes.
In any case we have source for our loved Linux, so ....
My answer is based on Debian, but IIRC in most distributions adduser is a script.
Quoted 4 lines
- Use 'adduser -k TEMPLATE', where template is a skeleton of the users's future directory, with right permissions set... But I think this solution won't work, because permissions may be inherited from the upper directory during the copy... Have a try :-)
I think it will not work because modes are hard-coded into adduser script.
Quick hack can be to change adduser script (it is Perl). Find chmod function in the script and set mode as you wish. BTW, there are separate modes for system-user and normal-user.
Proper solution is to make this configurable trough /etc/adduser.conf but that is job for "adduser" author/maintainer.
Milan