{"id":258,"date":"2014-03-25T23:00:37","date_gmt":"2014-03-25T23:00:37","guid":{"rendered":"http:\/\/www.incredigeek.com\/home\/?p=258"},"modified":"2017-03-29T15:22:51","modified_gmt":"2017-03-29T15:22:51","slug":"how-to-change-add-and-delete-users-in-linux","status":"publish","type":"post","link":"https:\/\/www.incredigeek.com\/home\/how-to-change-add-and-delete-users-in-linux\/","title":{"rendered":"How to Change, Add, and Delete Users in Linux"},"content":{"rendered":"<h2>Changing a users name:<\/h2>\n<pre>sudo usermod -l new-username old-username<\/pre>\n<p>To change the users directory name do the following.<\/p>\n<pre> sudo usermod -d \/home\/new-username<\/pre>\n<p>You might need to log in as root or another user to successfully execute the commands.<\/p>\n<h2>Adding a user:<\/h2>\n<pre>sudo useradd -m newuser<\/pre>\n<p>The -m option create the new users home directory<\/p>\n<p>Then to activate the user we need to setup a password.<\/p>\n<pre>sudo passwd newuser<\/pre>\n<p>Enter and reenter the password and your done.<\/p>\n<p>If you need to add the user to a certain group(s) (sudo?) you can do that with usermod<\/p>\n<pre>sudo usermod -G sudo,othergroups newuser<\/pre>\n<p>&nbsp;<\/p>\n<h2>Deleting a user:<\/h2>\n<pre>sudo userdel -r username<\/pre>\n<p>The &#8220;-r&#8221; option deletes the users mail and home directory.\u00a0 If you wanted to keep them then just discard that option.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Changing a users name: sudo usermod -l new-username old-username To change the users directory name do the following. sudo usermod -d \/home\/new-username You might need to log in as root or another user to successfully execute the commands. Adding a &hellip; <a href=\"https:\/\/www.incredigeek.com\/home\/how-to-change-add-and-delete-users-in-linux\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,3],"tags":[96,8,95,7,94,97],"class_list":["post-258","post","type-post","status-publish","format-standard","hentry","category-command-line","category-linux","tag-adding-users","tag-command-line-2","tag-deleting-users","tag-linux-2","tag-linux-users","tag-renaming-users"],"_links":{"self":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/258","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/comments?post=258"}],"version-history":[{"count":9,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/258\/revisions"}],"predecessor-version":[{"id":1575,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/258\/revisions\/1575"}],"wp:attachment":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/media?parent=258"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/categories?post=258"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/tags?post=258"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}