{"id":369,"date":"2010-02-21T10:27:40","date_gmt":"2010-02-21T10:27:40","guid":{"rendered":"http:\/\/mccltd.net\/blog\/?p=369"},"modified":"2010-02-21T10:30:39","modified_gmt":"2010-02-21T10:30:39","slug":"adding-users-and-groups-via-command-line-solaris","status":"publish","type":"post","link":"http:\/\/darenmatthews.com\/blog\/?p=369","title":{"rendered":"Adding Users and Groups via Command Line (Solaris)"},"content":{"rendered":"<p><strong>(And userstanding UIDs)<\/strong><\/p>\n<p>1. Login as root (or any account with UID=0) then create the new group:<\/p>\n<p>groupadd myusers\u00a0\u00a0 (a new entry is created in the \/etc\/group file)<!--more--><br \/>\n2. Now add the user:<\/p>\n<p>useradd -g myusers -m -d \/usr\/daren -c &#8220;Daren Matthews&#8221; -s \/bin\/sh -u 102 daren<\/p>\n<p>NOTE:<\/p>\n<p>-g Group Name<br \/>\n-m Make Home Directory (for user)<br \/>\n-d The location of the directory<br \/>\n-s The Shell to use (in this case, the Bourne Shell)<br \/>\n-u If you wish to specify a specific userid (optional)<\/p>\n<p>cat \/etc\/groups<br \/>\ncat \/etc\/passwd<br \/>\ncat \/etc\/shadow\u00a0 (is the user account locked? (&#8220;LK&#8221;) or does it have no password? (&#8220;NP&#8221;))<\/p>\n<p>3. Now set the password for the user:<\/p>\n<p>passwd daren<\/p>\n<p>NOW: copy the users profile file to a hidden file (preceded by dot \/ period (.))<\/p>\n<p>cp \/usr\/daren\/local.profile \/usr\/daren\/.profile<\/p>\n<p>ls \/usr\/daren\/profile\u00a0 (making sure it is created)<\/p>\n<p>rm \/usr\/daren\/local.profile\u00a0 (remove original unhidden file)<\/p>\n<p>4. Verify password for user:<\/p>\n<p>cat \/etc\/shadow<\/p>\n<p><strong><br \/>\nFOR REFERENCE: UID Values<\/strong><\/p>\n<p>0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Root User<br \/>\n1 &#8211; 100\u00a0\u00a0\u00a0\u00a0\u00a0 Internal System Accounts<br \/>\n101 &#8211; 60000\u00a0 Free for use by any user account<br \/>\n60001\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Root request from NFS server<br \/>\n60002\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Account access by non-logged in user<br \/>\n65534\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 the &#8220;Nobody&#8221; account<\/p>\n","protected":false},"excerpt":{"rendered":"<p>(And userstanding UIDs) 1. Login as root (or any account with UID=0) then create the new group: groupadd myusers\u00a0\u00a0 (a new entry is created in the \/etc\/group file)<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[14],"tags":[],"_links":{"self":[{"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/369"}],"collection":[{"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=369"}],"version-history":[{"count":4,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/369\/revisions"}],"predecessor-version":[{"id":373,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/369\/revisions\/373"}],"wp:attachment":[{"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=369"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=369"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=369"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}