Monday, August 3, 2009

User administration

In Sun Solaris 10,
# useradd -D
Reads the entry from the following file /usr/sadm/defadduser

Output:
# useradd -D
group=other,1 project=default,3 basedir=/home
skel=/etc/skel shell=/bin/sh inactive=0
expire= auths= profiles= roles= limitpriv=
defaultpriv= lock_after_retries=


# cat /usr/sadm/defadduser

Output:
# Default values for useradd. Changed Tue Jul 28 04:28:53 2009

defgroup=1
defgname=other
defparent=/home
defskel=/etc/skel
defshell=/bin/sh
definact=0
defexpire=
defauthorization=
defrole=
defprofile=
defproj=3
defprojname=default
deflimitpriv=
defdefaultpriv=
deflock_after_retries=


This file can be customized by root user, to change the default parameters to 'useradd' command
For eg:

# vi /usr/sadm/defadduser
defgroup=104
defgname=solaris
defparent=/export/home
defskel=/etc/skel
defshell=/bin/bash
definact=0
defexpire=
defauthorization=
defrole=
defprofile=
defproj=3
defprojname=default
deflimitpriv=
defdefaultpriv=
deflock_after_retries=
:wq!

After saving the changes to the file,

# useradd -D
group=solaris,104 project=default,3 basedir=/export/home
skel=/etc/skel shell=/bin/bash inactive=0
expire= auths= profiles= roles= limitpriv=
defaultpriv= lock_after_retries=

18 comments:

  1. I congrats to you for created the blog about Solaris Which may helpful to all...

    ReplyDelete
  2. informative , i have a query , How i create a user account with root privileges ??

    ReplyDelete
  3. i also hav a doubt....How to create a user account without using #useradd command...is it possible?

    ReplyDelete
  4. Hi jacob , it is possible to create users without using useradd command ,

    edit /etc/passwd file and add the user with default entry

    and save the file , you can test it by #su username

    ReplyDelete
  5. Hi Guna, you can duplicate the id of to the other user, for eg;
    # useradd -m -d /export/home/user1 -u 0 -o user1
    This will provide the root privileges to user1.

    In another case, we can also create user a/c with providing authorization.

    Hi Jacob,
    As Guna said, you can edit the file.
    Nor you can user SMC (Solaris Management Console) or #smuser command to create user account in Solaris.

    ReplyDelete
  6. thanx Guna & sir....but If we add lik this(editing /etc/passwd file),is it posssible to assign a home directory for that user?

    ReplyDelete
  7. Hi Jacob,
    No it's not possible. Home directory has to be manually created and permissions/ownership has to be assigned accordingly to work with the home directory!

    ReplyDelete
  8. this is the best solution for solaris discussion. you have done a great job sir.
    n how r u sinto?

    ReplyDelete
  9. hello sir , can i have any other procedure , instead of duplicating root id ?????

    ReplyDelete
  10. Hi Guna, give me some time let me check it out get to you. I think that it can be done through RDAC-authroization. Do you wanna to acquire all the previleges of root and only selected activities? Pls mention.

    ReplyDelete
  11. to guna........
    fine yaar...wht abt u?.........let me know whr r u frm?......n wht u r doing now?

    ReplyDelete
  12. This comment has been removed by the author.

    ReplyDelete
  13. working as technical consultant for HP-UX , Linux , Vmware , citrix , sco ,unixware , iam from chennai , iam a student of kamalakannan , i completed linux in accel ,

    i want full privileges of root user , but i dont want to specify root id for created user .

    RDAC or RBAC ??????

    ReplyDelete
  14. Hi Guna,
    It's possible to give all root privilege to non-root user without duplicating the root id.
    I checked thro' RBAC. IT's works!!!

    ReplyDelete
  15. hi sir i have newly joined to this blog

    ReplyDelete
  16. Hi sir i would like to know how to mount pen drive in solaris9 and also device name of pen drive in solaris 9

    ReplyDelete
  17. It's similar to mounting on Solaris-10.
    Please ref to : http://solaris-unlimited.blogspot.com/2011/08/how-to-mount-removable-media-on-solaris.html

    ReplyDelete