User Creation and Remove commands in solaris 10


Creating User Accounts
To create a user account:
# useradd -u 100 -g other -d /export/home/newuser1 -m -s /bin/ksh -c
"Regular User Account" newuser1
# passwd newuser1
# /usr/sadm/bin/smuser add -- -n newuser2 -u 500 -g other -d
/export/home/newuser2 -c "Regular User Account 2" -s /bin/ksh -x
autohome=N
# passwd newuser2
Modifying User Accounts
To change the login name and home directory for newuser1 to usera.
# usermod -m -d /export/home/usera -l usera newuser1
To change the login name and home directory for newuser2 to userb.
# /usr/sadm/bin/smuser modify -- -n newuser2 -N userb -d /export/home/userb
Deleting User Accounts

# userdel usera ==> to remove the user account
# userdel -r usera ==> to remove both the users account & home directory
# /usr/sadm/bin/smuser delete -- -n userb ==> the users home directory should be deleted manually
Creating a Group Entry

# groupadd -g 301 class1
# /usr/sadm/bin/smgroup add -- -n workgroup -g 123 -m usera
Modifying a Group Entry

# groupmod -g 400 class1 ==> to change group ID
To change group name

# /usr/sadm/bin/smgroup modify -- -n workgroup -N schoolgroup
Deleting a Group Entry

# groupdel class1
# /usr/sadm/bin/smgroup delete -- -n schoolgroup
# vi /etc/default/passwd ==> to control the properties for all users’ 
 passwords on the system:
# ls -l /usr/sadm/defadduser ==> to display default values for useradd 
 command
# useradd -D
# cat /usr/sadm/defadduser

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: