LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 02-19-2008, 07:36 PM   #1
rust8y
Member
 
Registered: May 2006
Posts: 100

Rep: Reputation: 15
Add new user in Solaris 10


Operating System: Solaris 10

How do I add a new user and specify the password from the command line after logging in as root?
 
Old 02-20-2008, 01:44 AM   #2
scoban
Member
 
Registered: Nov 2004
Location: Turkey
Distribution: Slackware
Posts: 145

Rep: Reputation: 16
man useradd
 
Old 02-20-2008, 02:26 AM   #3
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
and man passwd.

Alternatively, you can:
- edit /etc/passwd then run pwconv, passwd, mkdir, chown (the old way).
- use smc
- enable (webminsetup) and use webmin from a browser
 
Old 03-07-2008, 04:20 AM   #4
vikas027
Senior Member
 
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Ubuntu, Debian, OS X
Posts: 1,305

Rep: Reputation: 107Reputation: 107
simple one line solution to all your needs is:

Quote:
useradd -d /any/dir/ -m -c "any comment" -s /bin/default_shell -u UID -g group_name -G additional_group1,additional_group2 username
 
Old 03-19-2008, 11:40 PM   #5
prad77
Member
 
Registered: Mar 2008
Posts: 101

Rep: Reputation: 15
useradd -u 1002 -g 102 -m -d /home/export/user7 -s /bin/shThe
-m is to create the directory if it doesn't already exist.
And to set the password, you have to use the passwd command:
passwd username

Make sure you run both the commands as root.

Fedora Development

Last edited by prad77; 04-17-2008 at 03:17 AM.
 
  


Reply



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
Can't add local system user - useradd keeps saying user already exists ADeluiz Linux - Security 5 07-26-2013 03:17 PM
How to add user in Solaris 10? hacker supreme Solaris / OpenSolaris 2 05-27-2007 10:41 AM
add a user in solaris 9? anti.corp Solaris / OpenSolaris 23 05-26-2007 03:37 PM
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 09:18 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