LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here.

Notices

Reply
 
Search this Thread
Old 09-26-2007, 08:00 AM   #1
crisostomo_enrico
Member
 
Registered: Dec 2005
Location: Madrid
Distribution: Solaris 10, Solaris Express Community Edition
Posts: 547

Rep: Reputation: 35
How can I set the permission on the home directory when creating an user


Hi all.

Both creating an user with useradd and with smc, the newly created directory has permissions 755, that is, the default umask 022 has been used.

Is there a way to change this behavior (I want a 700 permission on user home directories)?

Bye,
Enrico.
 
Old 09-26-2007, 02:41 PM   #2
kebabbert
Member
 
Registered: Jul 2005
Posts: 461

Rep: Reputation: 41
Yes you can change the umask. Dont remember how. Is there a "umask" command?
 
Old 09-26-2007, 02:47 PM   #3
crisostomo_enrico
Member
 
Registered: Dec 2005
Location: Madrid
Distribution: Solaris 10, Solaris Express Community Edition
Posts: 547

Original Poster
Rep: Reputation: 35
Yes, umask can be changed (with the umask command, too). But I wanted to change the umask as a last resource: moreover, it should be changed only when creating user... Is there any useradd related option?
 
Old 09-26-2007, 04:12 PM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,486

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
There is no useradd option for setting permissions. The home directory is created with 0755 permissions. This is hardcoded in the command source code.

Of course, the current shell umask can limit these permissions. You can use
Code:
(umask 0077;useradd ...)
to achieve what you want without changing you current shell mask, or just use a wrapper script around useradd.
 
Old 09-26-2007, 06:24 PM   #5
crisostomo_enrico
Member
 
Registered: Dec 2005
Location: Madrid
Distribution: Solaris 10, Solaris Express Community Edition
Posts: 547

Original Poster
Rep: Reputation: 35
Thumbs up

Thanks jlliagre.

Strange choice, isn't it? By default, and in most of the cases, I wouldn't like my home directory to be world readable!

Quote:
or just use a wrapper script around useradd.
What I was thinking about, if I couldn't found a solution.

Thanks, as always.
Enrico

Last edited by crisostomo_enrico; 09-27-2007 at 04:50 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
permission of home directory binish Linux - Server 0 10-11-2006 11:58 PM
creating home directory jitheshmurali Linux - Networking 2 04-24-2006 06:03 AM
Creating new user gives empty /home directory rkfb Slackware 8 12-28-2005 11:17 AM
permission denied to home directory ekdya Debian 3 11-08-2005 04:24 PM
Home Directory Permission dvishloff Linux - General 1 08-11-2005 04:07 AM


All times are GMT -5. The time now is 10:20 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration