Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
09-26-2007, 08:00 AM
|
#1
|
Member
Registered: Dec 2005
Location: Madrid
Distribution: Solaris 10, Solaris Express Community Edition
Posts: 547
Rep:
|
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.
|
|
|
09-26-2007, 02:41 PM
|
#2
|
Member
Registered: Jul 2005
Posts: 527
Rep:
|
Yes you can change the umask. Dont remember how. Is there a "umask" command?
|
|
|
09-26-2007, 02:47 PM
|
#3
|
Member
Registered: Dec 2005
Location: Madrid
Distribution: Solaris 10, Solaris Express Community Edition
Posts: 547
Original Poster
Rep:
|
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?
|
|
|
09-26-2007, 04:12 PM
|
#4
|
Moderator
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,794
|
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.
|
|
|
09-26-2007, 06:24 PM
|
#5
|
Member
Registered: Dec 2005
Location: Madrid
Distribution: Solaris 10, Solaris Express Community Edition
Posts: 547
Original Poster
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 09:29 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|