Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to stop OSX from issuing warning for sudo command in terminal?

I have just updated to OSX Yosemite and every time I execute a sudo command, the OS issues this warning before the password prompt:

WARNING: Improper use of the sudo command could lead to data loss
or the deletion of important system files. Please double-check your
typing when using sudo.

How can this warning be silenced?

like image 962
myconode Avatar asked Oct 21 '14 18:10

myconode


People also ask

How do I use sudo on Mac terminal?

To run commands with superuser privileges, use the sudo command. sudo stands for superuser do. You're asked for the password of the current user. You're asked to enter the password for adminUsername, after which a new shell is opened for that user.

How do I exit sudo on Mac?

If you run sudo su , that will open a shell as the superuser. Type exit or Ctrl - D to exit this shell.

Does Mac Have sudo command?

What is sudo in Mac Terminal? Sudo is short for superuser do. It allows the permitted user (the administrator user) to run commands in Mac Terminal as a superuser or another user with extra security privileges.


1 Answers

To remove the warning, open the sudoers file:

sudo visudo

Add this line (to keep it tidy, just after the other Defaults):

Defaults:al !lecture

I've tried to set it to just "once" (Defaults lecture = once) but that seemed to be ignored.

like image 117
ahoffner Avatar answered Oct 04 '22 13:10

ahoffner