{"id":231,"date":"2016-06-29T00:17:28","date_gmt":"2016-06-28T18:47:28","guid":{"rendered":"http:\/\/www.middlewareprimer.com\/blog\/?p=231"},"modified":"2016-06-29T00:17:28","modified_gmt":"2016-06-28T18:47:28","slug":"user-administration-in-linux","status":"publish","type":"post","link":"http:\/\/www.middlewareprimer.com\/blog\/2016\/06\/29\/user-administration-in-linux\/","title":{"rendered":"User Administration in linux"},"content":{"rendered":"<p>In linux we have 3 types of users which are<\/p>\n<p>1.Super User(Root): It is a default user which created while installing the operating system.root is the super user in linux.<\/p>\n<p>2.System User: These users are created automatically by the operating system.Its function is managing system services.<\/p>\n<p>3.Normal User: These are created by super user that is root user<\/p>\n<p>To identify users system assign UID.<\/p>\n<p>UID for Root user &#8211; (0)<\/p>\n<p>UID for system user- (1-499)<\/p>\n<p>UID for Normal user -(1000-60,000)<\/p>\n<p>NOTE:<\/p>\n<ul>\n<li>After creating user,user home directory will be created in default path \/home.<\/li>\n<li>group will be created with same username.<\/li>\n<li>Mail account is created with same username at \/var\/spool\/mail\/username<\/li>\n<\/ul>\n<p>useful commands:<\/p>\n<p>useradd\/adduser\u00a0 username &#8211;&gt; To create user.<\/p>\n<p>The created user information is stored in file \u00a0\/etc\/passwd<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-233\" src=\"http:\/\/www.middlewareprimer.com\/blog\/wp-content\/uploads\/2016\/01\/1.1usercre-300x33.png\" alt=\"1.1usercre\" width=\"436\" height=\"48\" srcset=\"http:\/\/www.middlewareprimer.com\/blog\/wp-content\/uploads\/2016\/01\/1.1usercre-300x33.png 300w, http:\/\/www.middlewareprimer.com\/blog\/wp-content\/uploads\/2016\/01\/1.1usercre.png 411w\" sizes=\"auto, (max-width: 436px) 100vw, 436px\" \/><\/p>\n<p>userdel username &#8211;&gt; To delete user<\/p>\n<p>Note: we can delete the user but the corresponding home directory and mail account \u00a0can not be done with above command.<\/p>\n<p>so we have to delete by :<\/p>\n<p>rm -rf \/home\/username &#8211;&gt; To delete home directory of the created user<\/p>\n<p>rm -rf \u00a0\/var\/spool\/mail\/username &#8211;&gt;To delete mail account<\/p>\n<p>userdel -r username &#8211;&gt; To delete user along with home directory<\/p>\n<p>useradd \u2013u &lt;UID&gt; &lt;user name&gt;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8211; create user with specific UID.<\/p>\n<p>passwd username \u00a0 \u00a0 &#8211; \u00a0 \u00a0 change the user password<\/p>\n<p>userdel username \u00a0 \u00a0 &#8211; \u00a0 \u00a0 delete user<\/p>\n<p>userdel username \u00a0 \u00a0 &#8211; \u00a0 \u00a0 delete user including home directory<\/p>\n<p>finger username \u00a0 \u00a0 \u00a0&#8211; \u00a0 \u00a0 \u00a0see user properties<\/p>\n<p>chfn username \u00a0 \u00a0 \u00a0 \u00a0&#8211; \u00a0 \u00a0 \u00a0change user information<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In linux we have 3 types of users which are 1.Super User(Root): It is a default user which created while installing the operating system.root is the super user in linux. 2.System User: These users are created automatically by the operating system.Its function is managing system services. 3.Normal User: These are created by super user that [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[52],"tags":[206],"class_list":["post-231","post","type-post","status-publish","format-standard","hentry","category-linux","tag-user-creation-in-linux"],"_links":{"self":[{"href":"http:\/\/www.middlewareprimer.com\/blog\/wp-json\/wp\/v2\/posts\/231","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.middlewareprimer.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.middlewareprimer.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.middlewareprimer.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.middlewareprimer.com\/blog\/wp-json\/wp\/v2\/comments?post=231"}],"version-history":[{"count":7,"href":"http:\/\/www.middlewareprimer.com\/blog\/wp-json\/wp\/v2\/posts\/231\/revisions"}],"predecessor-version":[{"id":745,"href":"http:\/\/www.middlewareprimer.com\/blog\/wp-json\/wp\/v2\/posts\/231\/revisions\/745"}],"wp:attachment":[{"href":"http:\/\/www.middlewareprimer.com\/blog\/wp-json\/wp\/v2\/media?parent=231"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.middlewareprimer.com\/blog\/wp-json\/wp\/v2\/categories?post=231"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.middlewareprimer.com\/blog\/wp-json\/wp\/v2\/tags?post=231"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}