{"id":8798,"date":"2020-07-19T07:59:18","date_gmt":"2020-07-19T11:59:18","guid":{"rendered":"http:\/\/local.brightwhiz\/?p=8798"},"modified":"2022-04-25T01:22:08","modified_gmt":"2022-04-25T05:22:08","slug":"delete-users-ubuntu-20-04","status":"publish","type":"post","link":"http:\/\/local.brightwhiz\/delete-users-ubuntu-20-04\/","title":{"rendered":"How to Delete Users on Ubuntu 20.04 With deluser Command"},"content":{"rendered":"\n

In this guide, we showed you how to add users to Ubuntu 20.04 with adduser<\/em> and visudo<\/em> command utilities. There comes a time when you need to delete users and therefore this guide is the place that will show you how it is done.<\/p>\n\n\n\n

Please note that the steps here are the same for other previous Ubuntu<\/a> versions and other popular Linux<\/a> distros.<\/p>\n\n\n\n

Prerequisites<\/h2>\n\n\n\n

Because we are using Ubuntu 20.04 in this guide, you will need to have already set up one or more users with root administrative privileges. If you haven’t already, you can set this up using this initial server setup guide for Ubuntu 20.04<\/a>.<\/p>\n\n\n\n

Delete Users on Ubuntu 20.04<\/h2>\n\n\n\n

When users are no longer needed, it is always a good idea to delete them for administrative and security reasons.<\/p>\n\n\n\n

In case you want to delete the user itself, without deleting any of their files, simply type in the following deluser<\/em> command as root:<\/p>\n\n\n\n

deluser newuser<\/h2>\n\n\n\n

If you are signed in as another non-root user with sudo<\/em> privileges and you want to delete yet another user, you can type:<\/p>\n\n\n\n

$ sudo deluser newuser<\/code><\/pre>\n\n\n\n

There are cases where you also need to remove the user’s file usually in their home directory. You can do this by using the following command:<\/p>\n\n\n\n

$ sudo deluser --remove-home newuser<\/code><\/pre>\n\n\n\n

If you had previously configured sudo privileges for the user you deleted, be sure to remove the relevant line again by typing:<\/p>\n\n\n\n

$ sudo visudo<\/code><\/pre>\n\n\n\n

Then delete the corresponding line from the \/etc\/sudoers<\/em><\/p>\n\n\n\n

root ALL=(ALL:ALL) ALL\nnewuser ALL=(ALL:ALL) ALL # Delete this<\/code><\/pre>\n\n\n\n

This stops a new user created with the same name from accidentally inheriting sudo<\/em> privileges from a previous user.<\/p>\n\n\n\n

Conclusion<\/h2>\n\n\n\n

You can find out more about setting root privileges using visudo<\/em> or creating a new user entirely from this guide on how to add users to Ubuntu 20.04<\/a>. There is also a comprehensive guide on how to delete groups in Linux<\/a> using groupdel<\/em> and delgroup<\/em> utilities that is a must-read.<\/p>\n","protected":false},"excerpt":{"rendered":"

In this guide, we showed you how to add users to Ubuntu 20.04 with adduser and visudo command utilities. There comes a time when you need to delete users and…<\/p>\n","protected":false},"author":1,"featured_media":8799,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,23,16],"tags":[121,193,313,354,424,431,526,531,573,598],"yoast_head":"\nHow to Delete Users on Ubuntu 20.04 With deluser Command<\/title>\n<meta name=\"description\" content=\"This guide shows you how to delete users in Ubuntu 20.04 with the deluser command-line utility including the user's files\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/local.brightwhiz\/delete-users-ubuntu-20-04\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Delete Users on Ubuntu 20.04 With deluser Command\" \/>\n<meta property=\"og:description\" content=\"This guide shows you how to delete users in Ubuntu 20.04 with the deluser command-line utility including the user's files\" \/>\n<meta property=\"og:url\" content=\"http:\/\/local.brightwhiz\/delete-users-ubuntu-20-04\/\" \/>\n<meta property=\"og:site_name\" content=\"Brightwhiz.com\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/brightwhiz\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-07-19T11:59:18+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-04-25T05:22:08+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2020\/07\/delete-users-ubuntu-20-04.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Michael Bright\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@brightwhizmag\" \/>\n<meta name=\"twitter:site\" content=\"@brightwhizmag\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Michael Bright\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\/\/local.brightwhiz\/delete-users-ubuntu-20-04\/#article\",\"isPartOf\":{\"@id\":\"http:\/\/local.brightwhiz\/delete-users-ubuntu-20-04\/\"},\"author\":{\"name\":\"Michael Bright\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32\"},\"headline\":\"How to Delete Users on Ubuntu 20.04 With deluser Command\",\"datePublished\":\"2020-07-19T11:59:18+00:00\",\"dateModified\":\"2022-04-25T05:22:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/local.brightwhiz\/delete-users-ubuntu-20-04\/\"},\"wordCount\":314,\"publisher\":{\"@id\":\"http:\/\/local.brightwhiz\/#organization\"},\"image\":{\"@id\":\"http:\/\/local.brightwhiz\/delete-users-ubuntu-20-04\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2020\/07\/delete-users-ubuntu-20-04.jpg\",\"keywords\":[\"CentOS\",\"DevOps\",\"InfoSec\",\"Linux\",\"Open Source\",\"Operating Systems\",\"Security\",\"Server\",\"Systems Administration\",\"Ubuntu\"],\"articleSection\":[\"Articles\",\"Guides\",\"Technology\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/local.brightwhiz\/delete-users-ubuntu-20-04\/\",\"url\":\"http:\/\/local.brightwhiz\/delete-users-ubuntu-20-04\/\",\"name\":\"How to Delete Users on Ubuntu 20.04 With deluser Command\",\"isPartOf\":{\"@id\":\"http:\/\/local.brightwhiz\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\/\/local.brightwhiz\/delete-users-ubuntu-20-04\/#primaryimage\"},\"image\":{\"@id\":\"http:\/\/local.brightwhiz\/delete-users-ubuntu-20-04\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2020\/07\/delete-users-ubuntu-20-04.jpg\",\"datePublished\":\"2020-07-19T11:59:18+00:00\",\"dateModified\":\"2022-04-25T05:22:08+00:00\",\"description\":\"This guide shows you how to delete users in Ubuntu 20.04 with the deluser command-line utility including the user's files\",\"breadcrumb\":{\"@id\":\"http:\/\/local.brightwhiz\/delete-users-ubuntu-20-04\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/local.brightwhiz\/delete-users-ubuntu-20-04\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/local.brightwhiz\/delete-users-ubuntu-20-04\/#primaryimage\",\"url\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2020\/07\/delete-users-ubuntu-20-04.jpg\",\"contentUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2020\/07\/delete-users-ubuntu-20-04.jpg\",\"width\":1200,\"height\":630,\"caption\":\"Delete Users on Ubuntu 20.04\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/local.brightwhiz\/delete-users-ubuntu-20-04\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/local.brightwhiz\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Delete Users on Ubuntu 20.04 With deluser Command\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/local.brightwhiz\/#website\",\"url\":\"http:\/\/local.brightwhiz\/\",\"name\":\"Brightwhiz.com\",\"description\":\"Best Tech guides, Tutorials, and News\",\"publisher\":{\"@id\":\"http:\/\/local.brightwhiz\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/local.brightwhiz\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"http:\/\/local.brightwhiz\/#organization\",\"name\":\"Brightwhiz\",\"url\":\"http:\/\/local.brightwhiz\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/\",\"url\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png\",\"contentUrl\":\"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png\",\"width\":706,\"height\":135,\"caption\":\"Brightwhiz\"},\"image\":{\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/brightwhiz\/\",\"https:\/\/twitter.com\/brightwhizmag\",\"https:\/\/instagram.com\/bright_whiz\/\",\"https:\/\/www.pinterest.com\/sobbayi\/\",\"https:\/\/www.youtube.com\/channel\/UC6sCdP_d_RiTIM7ErFT-PSQ\"]},{\"@type\":\"Person\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32\",\"name\":\"Michael Bright\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/local.brightwhiz\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g\",\"contentUrl\":\"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g\",\"caption\":\"Michael Bright\"},\"sameAs\":[\"https:\/\/sobbayi.com\"],\"url\":\"http:\/\/local.brightwhiz\/author\/sobbayiadmin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Delete Users on Ubuntu 20.04 With deluser Command","description":"This guide shows you how to delete users in Ubuntu 20.04 with the deluser command-line utility including the user's files","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/local.brightwhiz\/delete-users-ubuntu-20-04\/","og_locale":"en_US","og_type":"article","og_title":"How to Delete Users on Ubuntu 20.04 With deluser Command","og_description":"This guide shows you how to delete users in Ubuntu 20.04 with the deluser command-line utility including the user's files","og_url":"http:\/\/local.brightwhiz\/delete-users-ubuntu-20-04\/","og_site_name":"Brightwhiz.com","article_publisher":"https:\/\/www.facebook.com\/brightwhiz\/","article_published_time":"2020-07-19T11:59:18+00:00","article_modified_time":"2022-04-25T05:22:08+00:00","og_image":[{"width":1200,"height":630,"url":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2020\/07\/delete-users-ubuntu-20-04.jpg","type":"image\/jpeg"}],"author":"Michael Bright","twitter_card":"summary_large_image","twitter_creator":"@brightwhizmag","twitter_site":"@brightwhizmag","twitter_misc":{"Written by":"Michael Bright","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/local.brightwhiz\/delete-users-ubuntu-20-04\/#article","isPartOf":{"@id":"http:\/\/local.brightwhiz\/delete-users-ubuntu-20-04\/"},"author":{"name":"Michael Bright","@id":"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32"},"headline":"How to Delete Users on Ubuntu 20.04 With deluser Command","datePublished":"2020-07-19T11:59:18+00:00","dateModified":"2022-04-25T05:22:08+00:00","mainEntityOfPage":{"@id":"http:\/\/local.brightwhiz\/delete-users-ubuntu-20-04\/"},"wordCount":314,"publisher":{"@id":"http:\/\/local.brightwhiz\/#organization"},"image":{"@id":"http:\/\/local.brightwhiz\/delete-users-ubuntu-20-04\/#primaryimage"},"thumbnailUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2020\/07\/delete-users-ubuntu-20-04.jpg","keywords":["CentOS","DevOps","InfoSec","Linux","Open Source","Operating Systems","Security","Server","Systems Administration","Ubuntu"],"articleSection":["Articles","Guides","Technology"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"http:\/\/local.brightwhiz\/delete-users-ubuntu-20-04\/","url":"http:\/\/local.brightwhiz\/delete-users-ubuntu-20-04\/","name":"How to Delete Users on Ubuntu 20.04 With deluser Command","isPartOf":{"@id":"http:\/\/local.brightwhiz\/#website"},"primaryImageOfPage":{"@id":"http:\/\/local.brightwhiz\/delete-users-ubuntu-20-04\/#primaryimage"},"image":{"@id":"http:\/\/local.brightwhiz\/delete-users-ubuntu-20-04\/#primaryimage"},"thumbnailUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2020\/07\/delete-users-ubuntu-20-04.jpg","datePublished":"2020-07-19T11:59:18+00:00","dateModified":"2022-04-25T05:22:08+00:00","description":"This guide shows you how to delete users in Ubuntu 20.04 with the deluser command-line utility including the user's files","breadcrumb":{"@id":"http:\/\/local.brightwhiz\/delete-users-ubuntu-20-04\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/local.brightwhiz\/delete-users-ubuntu-20-04\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/local.brightwhiz\/delete-users-ubuntu-20-04\/#primaryimage","url":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2020\/07\/delete-users-ubuntu-20-04.jpg","contentUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2020\/07\/delete-users-ubuntu-20-04.jpg","width":1200,"height":630,"caption":"Delete Users on Ubuntu 20.04"},{"@type":"BreadcrumbList","@id":"http:\/\/local.brightwhiz\/delete-users-ubuntu-20-04\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/local.brightwhiz\/"},{"@type":"ListItem","position":2,"name":"How to Delete Users on Ubuntu 20.04 With deluser Command"}]},{"@type":"WebSite","@id":"http:\/\/local.brightwhiz\/#website","url":"http:\/\/local.brightwhiz\/","name":"Brightwhiz.com","description":"Best Tech guides, Tutorials, and News","publisher":{"@id":"http:\/\/local.brightwhiz\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/local.brightwhiz\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"http:\/\/local.brightwhiz\/#organization","name":"Brightwhiz","url":"http:\/\/local.brightwhiz\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/","url":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png","contentUrl":"http:\/\/local.brightwhiz\/wp-content\/uploads\/2021\/11\/brightwhiz-com-logo-orange.png","width":706,"height":135,"caption":"Brightwhiz"},"image":{"@id":"http:\/\/local.brightwhiz\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/brightwhiz\/","https:\/\/twitter.com\/brightwhizmag","https:\/\/instagram.com\/bright_whiz\/","https:\/\/www.pinterest.com\/sobbayi\/","https:\/\/www.youtube.com\/channel\/UC6sCdP_d_RiTIM7ErFT-PSQ"]},{"@type":"Person","@id":"http:\/\/local.brightwhiz\/#\/schema\/person\/81f0f3126f13834ae2e7f381b3028e32","name":"Michael Bright","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/local.brightwhiz\/#\/schema\/person\/image\/","url":"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g","contentUrl":"http:\/\/1.gravatar.com\/avatar\/da90485875ff0aafa38fdd494abe87d1?s=96&d=mm&r=g","caption":"Michael Bright"},"sameAs":["https:\/\/sobbayi.com"],"url":"http:\/\/local.brightwhiz\/author\/sobbayiadmin\/"}]}},"_links":{"self":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/posts\/8798"}],"collection":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/comments?post=8798"}],"version-history":[{"count":0,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/posts\/8798\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/media\/8799"}],"wp:attachment":[{"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/media?parent=8798"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/categories?post=8798"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/local.brightwhiz\/wp-json\/wp\/v2\/tags?post=8798"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}