{"id":13281,"date":"2019-04-01T11:14:57","date_gmt":"2019-04-01T11:14:57","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=13281"},"modified":"2019-04-01T11:14:57","modified_gmt":"2019-04-01T11:14:57","slug":"how-to-show-asterisks-while-typing-sudo-password-in-linux","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/04\/01\/how-to-show-asterisks-while-typing-sudo-password-in-linux\/","title":{"rendered":"How to Show Asterisks While Typing Sudo Password in Linux"},"content":{"rendered":"<p>Most applications normally display a feedback using\u00a0<strong>asterisks<\/strong>\u00a0(<code>*******<\/code>) when a user is typing a password, but on the Linux terminal, when a normal user runs the\u00a0<a href=\"https:\/\/www.tecmint.com\/su-vs-sudo-and-how-to-configure-sudo-in-linux\/\" target=\"_blank\" rel=\"noopener\">sudo command<\/a>\u00a0to gain super user privileges, he\/she is asked for a password, but no visual feedback is seen by the user while typing the password.<\/p>\n<p>In this article, we will show how to display asterisks as feedback when you type passwords in the terminal in Linux.<\/p>\n<p>Take a look at the following screen shot, here the user\u00a0<strong>tecmint<\/strong>\u00a0has invoked the\u00a0<strong>sudo command<\/strong>\u00a0to install the\u00a0<a href=\"https:\/\/www.tecmint.com\/vi-editor-usage\/\" target=\"_blank\" rel=\"noopener\">vim text editor<\/a>\u00a0in\u00a0<strong>CentOS 7<\/strong>, but there is no visual feedback as the password is typed (in this case the password has already been entered):<\/p>\n<pre>$ sudo yum install vim\r\n<\/pre>\n<div id=\"attachment_28330\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/01\/Sudo-Password.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-28330\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/01\/Sudo-Password.png\" alt=\"No Sudo Password Shown\" width=\"476\" height=\"44\" aria-describedby=\"caption-attachment-28330\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-28330\" class=\"wp-caption-text\">No Sudo Password Shown<\/p>\n<\/div>\n<p>You can enable the password feedback feature in\u00a0<strong>\/etc\/sudoers<\/strong>\u00a0file, but first create a backup of the file, then open it for editing using the\u00a0<strong>visudo<\/strong>\u00a0command.<\/p>\n<pre>$ sudo cp \/etc\/sudoers \/etc\/sudoers.bak\r\n$ sudo visudo \r\n<\/pre>\n<p>Search for the following line.<\/p>\n<pre>Defaults env_reset\r\n<\/pre>\n<p>And append\u00a0<strong>pwfeedback<\/strong>\u00a0to it, so that it looks like this.<\/p>\n<pre>Defaults env_reset,pwfeedback\r\n<\/pre>\n<div id=\"attachment_28333\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/01\/Configure-Sudoers-File.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-28333\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/01\/Configure-Sudoers-File.png\" alt=\"Configure Sudoers File\" width=\"522\" height=\"246\" aria-describedby=\"caption-attachment-28333\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-28333\" class=\"wp-caption-text\">Configure Sudoers File<\/p>\n<\/div>\n<p>Now press\u00a0<strong>Esc<\/strong>\u00a0key and type\u00a0<code>:wq<\/code>\u00a0to save and close the file. But if you are using nano editor, save the file by hitting \u201c<strong>Ctrl+x<\/strong>\u201d and then\u00a0<code>\u201cy\u201d<\/code>\u00a0followed by\u00a0<strong>\u201cENTER\u201d<\/strong>\u00a0to close it.<\/p>\n<p>Then run the command below to reset your terminal for the above changes to start working.<\/p>\n<pre>$ reset\r\n<\/pre>\n<p>That\u2019s it, now you should be able to see a visual feedback (<code>****<\/code>) every time when you typing a password on the terminal, as shown in the following screen shot.<\/p>\n<pre>$ sudo yum update\r\n<\/pre>\n<div id=\"attachment_28332\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/01\/Visible-Sudo-Password.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-28332\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/01\/Visible-Sudo-Password.png\" alt=\"Visible Sudo Password\" width=\"436\" height=\"52\" aria-describedby=\"caption-attachment-28332\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-28332\" class=\"wp-caption-text\">Visible Sudo Password<\/p>\n<\/div>\n<p>You might also like to read these following related articles.<\/p>\n<ol>\n<li><a href=\"https:\/\/www.tecmint.com\/sudoers-configurations-for-setting-sudo-in-linux\/\" target=\"_blank\" rel=\"noopener\">10 Useful Sudoers Configurations for Setting \u2018sudo\u2019 in Linux<\/a><\/li>\n<li><a href=\"https:\/\/www.tecmint.com\/run-sudo-command-without-password-linux\/\" target=\"_blank\" rel=\"noopener\">How to Run \u2018sudo\u2019 Command Without Entering a Password in Linux<\/a><\/li>\n<li><a href=\"https:\/\/www.tecmint.com\/sudo-insult-when-enter-wrong-password\/\" target=\"_blank\" rel=\"noopener\">Let Sudo Insult You When You Enter Incorrect Password<\/a><\/li>\n<li><a href=\"https:\/\/www.tecmint.com\/run-shell-scripts-with-sudo-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">How to Run Shell Scripts with Sudo Command in Linux<\/a><\/li>\n<\/ol>\n<p>If you have any Linux terminal tips or tricks to share with us, use the comment section below.<\/p>\n<p><a href=\"https:\/\/www.tecmint.com\/show-asterisks-sudo-password-in-linux\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Most applications normally display a feedback using\u00a0asterisks\u00a0(*******) when a user is typing a password, but on the Linux terminal, when a normal user runs the\u00a0sudo command\u00a0to gain super user privileges, he\/she is asked for a password, but no visual feedback is seen by the user while typing the password. In this article, we will show &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/04\/01\/how-to-show-asterisks-while-typing-sudo-password-in-linux\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to Show Asterisks While Typing Sudo Password in Linux&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-13281","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13281","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=13281"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13281\/revisions"}],"predecessor-version":[{"id":13282,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13281\/revisions\/13282"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=13281"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=13281"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=13281"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}