LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
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


Reply
  Search this Thread
Old 04-01-2006, 11:24 AM   #1
anti.corp
Member
 
Registered: Nov 2005
Location: Copenhagen
Distribution: Debian E, Vectorlinux 5.1std, Arch, Gentoo 2006.0
Posts: 576

Rep: Reputation: 30
add a user in solaris 9?


Hi,

I just installed solaris 9 on my sparc.

How do I add a user, so I dont need to login as root?

Sincerely, Jorgen
 
Old 04-01-2006, 03:59 PM   #2
AxeZ
Member
 
Registered: Sep 2002
Location: Novi Sad, Vojvodina
Distribution: Slackware, FreeBSD
Posts: 386

Rep: Reputation: 32
I believe useradd is what you need.
 
Old 04-02-2006, 03:30 AM   #3
apt-get-dude
Member
 
Registered: Mar 2006
Posts: 98

Rep: Reputation: 15
Example:

groupadd -g 100 users
useradd -u 101 -g 100 -md /export/home/user1 -c "new user" -s /bin/ksh user1
passwd user1
 
Old 04-02-2006, 06:54 AM   #4
anti.corp
Member
 
Registered: Nov 2005
Location: Copenhagen
Distribution: Debian E, Vectorlinux 5.1std, Arch, Gentoo 2006.0
Posts: 576

Original Poster
Rep: Reputation: 30
Thanks alot for your help.

I didnt feel that comfortable loggin in as root all the time.

Sincerely, Jorgen
 
Old 04-02-2006, 06:52 PM   #5
saudoi
Member
 
Registered: Aug 2004
Location: VietNam
Distribution: Sun Solaris 10
Posts: 117

Rep: Reputation: 15
You can login as normal user and su to root whenever you need to add user (or do some admin tasks).
 
Old 04-03-2006, 12:02 PM   #6
AbrahamJose
Member
 
Registered: Feb 2006
Location: India
Posts: 167

Rep: Reputation: 31
Post smc

Use smc (Solaris Management Console)

As it is solaris9 U can use admintool also
 
Old 04-16-2006, 11:12 PM   #7
mdhmi
Member
 
Registered: Dec 2005
Location: Detroit, Michigan
Distribution: Ubuntu
Posts: 86

Rep: Reputation: 15
You can use SMC (garbage) or the "useradd" command or "vipw" followed by "pwconv" if you know what you're doing.

Mark
 
Old 04-17-2006, 04:58 AM   #8
sc425000
LQ Newbie
 
Registered: Jan 2006
Posts: 8

Rep: Reputation: 0
you must have root privileges for add user or do anything tin admin task
 
Old 04-17-2006, 05:52 AM   #9
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Technically, you do not need to be root to create users under Solaris, you just need to have the privilege to do it.

See for example http://www.softpanorama.org/Solaris/...ris_rbac.shtml for details.
 
Old 04-17-2006, 11:41 PM   #10
mdhmi
Member
 
Registered: Dec 2005
Location: Detroit, Michigan
Distribution: Ubuntu
Posts: 86

Rep: Reputation: 15
True, but I've never actually seen people go through the hassle of using RBAC properly. Most folks just use sudo as it's simple and portable.

Don't forget to make a backup of /etc/shadow and /etc/passwd before making any changes.

Mark
 
Old 04-18-2006, 02:22 AM   #11
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
I understand that, and it's the reason why I wrote "technically".

I see however Sun's customers starting to use RBAC, which is far less complicated to set that people usually think.

For example, if I want you to be able to manage user accounts, I simply have to add or update this line in the /etc/user_attr file:
Code:
mdhmi::::type=normal;profiles=User Management
Then you'll be able for example to run "pfexec useradd" to create a user account.

If you want to be able to call useradd stile commands without the pfexec prefix, your shell can be replaced by an RBAC aware shell, like /usr/bin/pfksh, in the /etc/passwd file.

I wouldn't say all this is that more complicated than sudo.

It is actually simpler in that example, given the fact the required profile already exists.
 
Old 04-18-2006, 09:58 AM   #12
javier.e.menendez
Member
 
Registered: Jan 2006
Posts: 168

Rep: Reputation: 30
Although sudo is commonly used, there is nothing difficult about rbac.

Here is an example on how to create a role with a brand new privilege from scratch.

---

1. Create a regular user

# groupadd -g 100 users

# useradd -u 100 -g 100 -md /export/home/user1 -s /bin/ksh user1
# passwd user1 <- make it user1

2. Verify if the user is associated to any roles

# roles user1
No roles

3. Create a role (special account) that will be able to halt the system

# roleadd -u 200 -g 10 -md /export/home/halt halt
# passwd halt <- make it halt1


4. Verify the automatic changes in /etc/user_attr

# grep halt /etc/user_attr
halt::::type=role;profiles=All

5. Create a profile for the role account

# echo halt:::halting profile for halt role: >> /etc/security/prof_attr

# grep halt /etc/security/prof_attr
halt:::halting profile for halt role:

6. Add the profile to the role account

# rolemod -P halt halt

# grep halt /etc/user_attr
halt::::type=role;profiles=halt

7. Assign the role to the existing user

# usermod -R halt user1

# grep halt /etc/user_attr
halt::::type=role;profiles=halt
user1::::type=normal;roles=halt

# roles user1
halt

8. Specify the command to be run by the role account

# echo halt:suser:cmd:::/usr/sbin/halt:euid=0 >> /etc/security/exec_attr

9. Test your configuration as the user user1 [should fail]

# su – user1

$ /usr/sbin/halt
halt: permission denied

10. Test your configuration after switching users to the role halt [should work]

# su – user1 ; su - halt

# /usr/sbin/halt <- the system should halt now
 
Old 04-18-2006, 11:27 AM   #13
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Just a warning, "halt" is a command that shoulnd't be generally used to shutdown a Solaris box, especially when services are enabled, because it doesn't go to the smf services shutdown, nor the rc kill commands.

The recommended way is using "init 5" or "shutdown -y -i 5 -g 0".

Also, to allow a user to shutdown a machine, you can simply give this user the "Maintenance and Repair" role.
 
Old 04-19-2006, 07:14 AM   #14
javier.e.menendez
Member
 
Registered: Jan 2006
Posts: 168

Rep: Reputation: 30
There you go again,

This is just an example and by the way, init 5 is not the prefered way to halt, it is
instead init 0. init 5 is the prefered way to poweroff.
 
Old 04-19-2006, 09:53 AM   #15
mdhmi
Member
 
Registered: Dec 2005
Location: Detroit, Michigan
Distribution: Ubuntu
Posts: 86

Rep: Reputation: 15
I agree Javier that RBAC is useable, we have used it on and off over the years in our environment. Our corporate directive is portability, which is why we usually use sudo as we have a mixed Solaris / AIX environment.

Mark
 
  


Reply

Tags
solaris



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
How to list user in Linux box, add an user to a group! steady_lfcfan Linux - Newbie 12 01-27-2013 01:14 PM
user home dir doesn't create when new user add dev_mohamed Linux - Software 3 01-12-2007 01:08 AM
add partitions in solaris Maidros Solaris / OpenSolaris 4 01-21-2006 01:06 PM
Help! Cannot Add a User to User Manager or Change Root Password lennysokol Linux - General 2 06-25-2005 09:59 AM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration