{"id":21041,"date":"2023-09-30T11:20:24","date_gmt":"2023-09-30T11:20:24","guid":{"rendered":"https:\/\/linuxways.net\/?p=21041"},"modified":"2023-09-30T11:20:24","modified_gmt":"2023-09-30T11:20:24","slug":"how-do-i-exit-sudo-mode-in-ubuntu-22-04","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/ubuntu\/how-do-i-exit-sudo-mode-in-ubuntu-22-04\/","title":{"rendered":"How do I Exit sudo Mode in Ubuntu 22.04?"},"content":{"rendered":"<p>Sudo means \u201c<strong>Super User Do<\/strong>\u201d and it allows users to have root privileges. With Sudo, a user gets complete access to access files, edit files, and delete files as well. Sudo allows specific users to get administrative-level access. Sudo should only be used when required as it gives users more power over the system which may lead to security concerns and thus should be utilized with caution.<\/p>\n<p>This article explains the methods to exit sudo mode in Ubuntu.<\/p>\n<h2><strong>How do I Exit sudo Mode in Ubuntu?<\/strong><\/h2>\n<p>The sudo mode can be exited in the Ubuntu Terminal using a shortcut or several different methods. All the methods are mentioned below:<\/p>\n<h2><strong>Method 1: Exit sudo Mode Using the \u201cexit\u201d Command<\/strong><\/h2>\n<p>The sudo mode can be exited from Terminal Simply using the \u201cexit\u201d command. The snippet below shows the user is in the Root mode meaning the user has the sudo privileges:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"821\" height=\"276\" class=\"wp-image-21042\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-1.png 821w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-1-300x101.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-1-768x258.png 768w\" sizes=\"auto, (max-width: 821px) 100vw, 821px\" \/><\/p>\n<p>The \u201cexit\u201d command will make the sudo user a normal user by logging him out. The \u201cexit\u201d command can be used as:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw3\">exit<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"815\" height=\"95\" class=\"wp-image-21043\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-2.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-2.png 815w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-2-300x35.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-2-768x90.png 768w\" sizes=\"auto, (max-width: 815px) 100vw, 815px\" \/><\/p>\n<h2><strong>Method 2: Exit sudo Mode Using the Shortcut Key<\/strong><\/h2>\n<p>Apart from using the command statement, the terminal also supports shortcut keys and one of them can be used to exit from the Sudo Mode Using the \u201cctrl+D\u201d keys:<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"829\" height=\"102\" class=\"wp-image-21044\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-3.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-3.png 829w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-3-300x37.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-3-768x94.png 768w\" sizes=\"auto, (max-width: 829px) 100vw, 829px\" \/><\/strong><\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"1514\" height=\"363\" class=\"wp-image-21045\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-4.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-4.png 1514w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-4-300x72.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-4-1024x246.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-4-768x184.png 768w\" sizes=\"auto, (max-width: 1514px) 100vw, 1514px\" \/><\/strong><\/p>\n<p>Once used, the sudo mode is logged out:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"817\" height=\"94\" class=\"wp-image-21046\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-5.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-5.png 817w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-5-300x35.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-5-768x88.png 768w\" sizes=\"auto, (max-width: 817px) 100vw, 817px\" \/><\/p>\n<h2><strong>Method 3: Exit sudo Mode Using the \u201clogout\u201d Command<\/strong><\/h2>\n<p>Using the \u201clogout\u201d command also makes the sudo user a normal user by logging him out. The \u201clogout\u201d command can be executed as:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw3\">logout<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"817\" height=\"64\" class=\"wp-image-21047\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-6.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-6.png 817w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-6-300x24.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-6-768x60.png 768w\" sizes=\"auto, (max-width: 817px) 100vw, 817px\" \/><\/p>\n<h2><strong>Method 4: Exit sudo Mode Closing the Terminal Window<\/strong><\/h2>\n<p>The sudo mode automatically closes once the terminal closes. By default, the normal user command line appears in the terminal.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"820\" height=\"131\" class=\"wp-image-21048\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-7.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-7.png 820w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-7-300x48.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-7-768x123.png 768w\" sizes=\"auto, (max-width: 820px) 100vw, 820px\" \/><\/p>\n<p>Closing the terminal will log out the sudo user. Re-opening the terminal using either the shortcut key \u201cctril+alt+T\u201d or opening from the GUI will confirm that the normal user mode appears:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"816\" height=\"111\" class=\"wp-image-21049\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-8.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-8.png 816w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-8-300x41.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-8-768x104.png 768w\" sizes=\"auto, (max-width: 816px) 100vw, 816px\" \/><\/p>\n<h2><strong>Bonus Tip: Logging in as a Sudo User<\/strong><\/h2>\n<p>If you want to log in again as a sudo user, you can use the command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> <span class=\"re5\">-i<\/span><\/div><\/div>\n<p>The Command Line will ask for authentication:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1138\" height=\"57\" class=\"wp-image-21050\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-9.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-9.png 1138w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-9-300x15.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-9-1024x51.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-9-768x38.png 768w\" sizes=\"auto, (max-width: 1138px) 100vw, 1138px\" \/><\/p>\n<p>Enter the sudo user password to authenticate. Once Done, you will see the root statement mentioning you logged in as a sudo user:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1109\" height=\"89\" class=\"wp-image-21051\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-10.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-10.png 1109w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-10-300x24.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-10-1024x82.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/09\/word-image-21041-10-768x62.png 768w\" sizes=\"auto, (max-width: 1109px) 100vw, 1109px\" \/><\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>Logging out or exiting from the Sudo Mode in Ubuntu is an easy process. With the \u201c<strong>exit<\/strong>\u201d, \u201c<strong>logout<\/strong>\u201d or \u201cctrl+D\u201d shortcut key, a sudo user can easily log out and be a normal user of the system. This article has explained several methods to log out\/exit sudo mode.<\/p>","protected":false},"excerpt":{"rendered":"<p>Sudo mode can be exited in Ubuntu using a shortcut key or closing terminal. Easily log out from the Ubuntu system as a sudo user using the \u201cexit\u201d or \u201clogout\u201d.<\/p>","protected":false},"author":110,"featured_media":21440,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-21041","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ubuntu"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/21041","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/110"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=21041"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/21041\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/21440"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=21041"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=21041"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=21041"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}