92

Whenever I open the terminal,

To run a command as administrator (user "root"), use "sudo <command>".  
See "man sudo_root" for details.

appears before the terminal. How do I get that to go away?

  • Interesting. I once saw such a thing, but never on terminal I open myself. How would I get that back if I wanted it? – MPi Jan 21 '11 at 15:41
119

Once you run a sudo command, the file ~/.sudo_as_admin_successful will be created and the warning will go away. So either run a sudo command, such as sudo apt-get update or create the ~/.sudo_as_admin_successful file manually:

touch ~/.sudo_as_admin_successful

If you want the warning back for whatever reason, remove ~/.sudo_as_admin_successful:

rm ~/.sudo_as_admin_successful
  • 18
    Is there a way to remove this functionality completely? – tubaguy50035 Apr 18 '14 at 8:11
  • 1
    It is just a test and a message to say "did you know, you can use sudo to run commands as admin". – HankCa Oct 26 '16 at 0:31
36

Maverick? Comment it out: sudo vim /etc/bash.bashrc. The section, commented:

# sudo hint
# if [ ! -e "$HOME/.sudo_as_admin_successful" ]; then
#     case " $(groups) " in *\ admin\ *)
#     if [ -x /usr/bin/sudo ]; then
#     cat <<-EOF
#     To run a command as administrator (user "root"), use "sudo <command>".
#     See "man sudo_root" for details.
#    
#     EOF
#     fi
#     esac
# fi

Finding the file to start:

$ sudo grep -R "man sudo_root" /etc

The result:

/etc/bash.bashrc:   See "man sudo_root" for details.

and then scroll though the output until you see which file contains "man sudo_root".

  • I was wondering where it was coming from, and this answers it. Thanks! – mouche Jan 26 '11 at 6:06
3

This should not happen, unless you did not yet run any command using sudo (sudo echo "hello" should be enough).

If you did run a command using sudo and you don't see the file ~/.sudo_as_admin_successful, then you are probably hit by this bug.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.