{"id":10986,"date":"2021-10-15T10:45:47","date_gmt":"2021-10-15T10:45:47","guid":{"rendered":"https:\/\/linuxways.net\/?p=10986"},"modified":"2021-10-15T10:45:47","modified_gmt":"2021-10-15T10:45:47","slug":"show-asterisks-while-typing-sudo-password-in-linux-ubuntu-and-centos-example","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/centos\/show-asterisks-while-typing-sudo-password-in-linux-ubuntu-and-centos-example\/","title":{"rendered":"Show Asterisks While Typing Sudo Password in Linux (Ubuntu and CentOS Example)"},"content":{"rendered":"<p>In Linux, there is a privilege for users like sudo privilege. In case of using the sudo command on the terminal, you will be asked for a password. When you type a password, you will not see any visual feedback like an asterisk or anything.<\/p>\n<p>For example:<\/p>\n<p>Here, we are trying to run the command \u201csudo apt update\u201d then it asks for a password. After entering the password, there is no visual feedback and it shows blank on the password section.<\/p>\n<pre>$ sudo apt update<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"605\" height=\"102\" class=\"wp-image-10987\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-151.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-151.png 605w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-151-300x51.png 300w\" sizes=\"auto, (max-width: 605px) 100vw, 605px\" \/><\/p>\n<p>But if you want some visual feedback like an asterisk on the password field, it can be sorted out with small changes on the \/etc\/sudoers file. You can backup this file first before changing it with the following command:<\/p>\n<pre>$ sudo cp \/etc\/sudoers \/etc\/sudoers.bak<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"604\" height=\"68\" class=\"wp-image-10988\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-152.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-152.png 604w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-152-300x34.png 300w\" sizes=\"auto, (max-width: 604px) 100vw, 604px\" \/><\/p>\n<h3>To show asterisk while typing sudo password on Linux<\/h3>\n<p>Now, to edit the \/etc\/sudoers file, you can simply run the following command.<\/p>\n<pre>$ sudo visudo<\/pre>\n<p>You must have to search the following line and do some changes on that section.<\/p>\n<pre>Defaults env_reset<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"725\" height=\"422\" class=\"wp-image-10989\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-153.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-153.png 725w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-153-300x175.png 300w\" sizes=\"auto, (max-width: 725px) 100vw, 725px\" \/><\/p>\n<p>Now append pwfeedback on this line for showing the asterisk on the password section.<\/p>\n<pre>Defaults env_reset, pwfeedback<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"724\" height=\"428\" class=\"wp-image-10990\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-154.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-154.png 724w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-154-300x177.png 300w\" sizes=\"auto, (max-width: 724px) 100vw, 724px\" \/><\/p>\n<p>Press ctrl + x to save the changes and then y to exit.<\/p>\n<p>Now you can try to run the previous command and check if you can see any visual feedback on the password section after using sudo.<\/p>\n<pre>$ sudo apt update<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"608\" height=\"254\" class=\"wp-image-10991\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-155.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-155.png 608w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-155-300x125.png 300w\" sizes=\"auto, (max-width: 608px) 100vw, 608px\" \/><\/p>\n<p>Finally, you can see the asterisk as a visual on the password after some changes on the \/etc\/sudoers file.<\/p>\n<h2>Conclusion:<\/h2>\n<p>Now, you get the idea to show an asterisk as visual feedback while typing sudo password. Try once on Ubuntu or Centos by doing small changes on the file on \/etc\/sudoers file. Thank you!<\/p>\n<p>&nbsp;<\/p>","protected":false},"excerpt":{"rendered":"<p>In Linux, there is a privilege for users like sudo privilege. In case of using the sudo command on the terminal, you will be asked for a password.&hellip;<\/p>","protected":false},"author":1,"featured_media":11191,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,2],"tags":[609,38,35,250,31],"class_list":["post-10986","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos","category-ubuntu","tag-asterisks","tag-centos","tag-linux","tag-sudo","tag-ubuntu"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/10986","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\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=10986"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/10986\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/11191"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=10986"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=10986"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=10986"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}