{"id":31,"date":"2012-02-05T15:45:19","date_gmt":"2012-02-05T22:45:19","guid":{"rendered":"http:\/\/somethingk.com\/main\/?p=31"},"modified":"2013-05-12T20:15:08","modified_gmt":"2013-05-13T03:15:08","slug":"termainl-list-users","status":"publish","type":"post","link":"https:\/\/somethingk.com\/main\/termainl-list-users\/","title":{"rendered":"Termainl User Commands"},"content":{"rendered":"<p><strong>List Users:<\/strong> cat \/etc\/passwd | grep &#8220;\/home&#8221; |cut -d: -f1 &amp;&amp; cat \/etc\/passwd | grep &#8220;\/root&#8221; |cut -d: -f1<\/p>\n<p>The Command &#8216;cat \/etc\/passwd | grep &#8220;\/home&#8221; |cut -d: -f1&#8217; on its own will list all the users found in the home directory. However root is not found in that directory so I added the additional statement to grep users in the \/root directory, which will be root.<\/p>\n<p><a href=\"http:\/\/somethingk.com\/main\/wp-content\/uploads\/2012\/02\/userL.png\"><img decoding=\"async\" class=\"aligncenter size-medium wp-image-32\" title=\"Display Linux Users\" alt=\"\" src=\"http:\/\/somethingk.com\/main\/wp-content\/uploads\/2012\/02\/userL-300x45.png\" width=\"300\" height=\"45\" srcset=\"https:\/\/somethingk.com\/main\/wp-content\/uploads\/2012\/02\/userL-300x45.png 300w, https:\/\/somethingk.com\/main\/wp-content\/uploads\/2012\/02\/userL.png 998w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><strong><\/strong><\/p>\n<p><strong>Add User: <\/strong>adduser &lt;username&gt; <strong>OR<\/strong> useradd &lt;username&gt;<\/p>\n<p><strong>Remove User: <\/strong>userdel &lt;username&gt;<\/p>\n<p><a href=\"http:\/\/somethingk.com\/main\/wp-content\/uploads\/2012\/02\/userL2.png\"><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-medium wp-image-35\" title=\"Add a User in Linux\" alt=\"\" src=\"http:\/\/somethingk.com\/main\/wp-content\/uploads\/2012\/02\/userL2-300x214.png\" width=\"300\" height=\"214\" srcset=\"https:\/\/somethingk.com\/main\/wp-content\/uploads\/2012\/02\/userL2-300x214.png 300w, https:\/\/somethingk.com\/main\/wp-content\/uploads\/2012\/02\/userL2.png 409w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><strong>Create User gGoup:<\/strong> groupadd &lt;group name&gt;<\/p>\n<p><strong>Add User to a Group:<\/strong> usermod -a -G &lt;group name&gt; &lt;username&gt;<\/p>\n<p><strong>Remove user:<\/strong><\/p>\n<ol>\n<li>vi \/etc\/group<\/li>\n<li>Find the group and delete the user from it&#8217;s details<\/li>\n<li>Save File (Hit ESC then type :wq ENTER)<\/li>\n<\/ol>\n<p style=\"text-align: center;\"><a href=\"http:\/\/somethingk.com\/main\/wp-content\/uploads\/2012\/02\/lgroup.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-36\" title=\"Linux Group\" alt=\"\" src=\"http:\/\/somethingk.com\/main\/wp-content\/uploads\/2012\/02\/lgroup.png\" width=\"221\" height=\"120\" \/><\/a>to<a href=\"http:\/\/somethingk.com\/main\/wp-content\/uploads\/2012\/02\/lgroup2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-37\" title=\"Linux Group\" alt=\"\" src=\"http:\/\/somethingk.com\/main\/wp-content\/uploads\/2012\/02\/lgroup2.png\" width=\"176\" height=\"55\" \/><\/a><strong><\/strong><\/p>\n<p style=\"text-align: left;\"><strong>Delete Group:<\/strong> groupdel &lt;group name&gt;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>List Users: cat \/etc\/passwd | grep &#8220;\/home&#8221; |cut -d: -f1 &amp;&amp; cat \/etc\/passwd | grep &#8220;\/root&#8221; |cut -d: -f1 The Command &#8216;cat \/etc\/passwd | grep &#8220;\/home&#8221; |cut -d: -f1&#8217; on its own will list all the users found in the home directory. However root is not found in that directory so I added the additional statement to grep users in [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[40,9,5,10],"class_list":["post-31","post","type-post","status-publish","format-standard","hentry","category-linux","tag-add-user","tag-command","tag-terminal","tag-user"],"_links":{"self":[{"href":"https:\/\/somethingk.com\/main\/wp-json\/wp\/v2\/posts\/31","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/somethingk.com\/main\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/somethingk.com\/main\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/somethingk.com\/main\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/somethingk.com\/main\/wp-json\/wp\/v2\/comments?post=31"}],"version-history":[{"count":8,"href":"https:\/\/somethingk.com\/main\/wp-json\/wp\/v2\/posts\/31\/revisions"}],"predecessor-version":[{"id":233,"href":"https:\/\/somethingk.com\/main\/wp-json\/wp\/v2\/posts\/31\/revisions\/233"}],"wp:attachment":[{"href":"https:\/\/somethingk.com\/main\/wp-json\/wp\/v2\/media?parent=31"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/somethingk.com\/main\/wp-json\/wp\/v2\/categories?post=31"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/somethingk.com\/main\/wp-json\/wp\/v2\/tags?post=31"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}