Tuesday, March 6, 2012

User Creation and Remove commands in solaris 10

Hi,
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 

                                        Thanks for Reading. 

No comments:

Post a Comment

Popular Posts

Followers

Disclaimer

All Data and Information Provided on This BLOG is only for Education purposes only.If you done any thing else these in real time the blog is not Responsible.Try all those on your own risk.
IF you find any thing else here as per in violation of copyright law .mail me on srinathceh@gmail.com as soon as possible action will be taken.