home | tech | misc | code | bookmarks (broken) | contact | README

Sudo Tips

Change $PATH for sudo

sudo doesn't use the user path, but a predefined path that includes common directories (/bin, /usr/bin, etc.). To change it, put the following line in the sudoers file:

Defaults        secure_path=/your/secure:/path/list

Reference: http://www.linuxforums.org/forum/linux-newbie/165107-solved-editing-sudoers.html

Make sudo always ask for password

After executing a command with sudo, it doesn't ask for the password for a few minutes, if you use the same terminal. If you want to force sudo to always ask for a password, include it in the sudoers file:

Defaults timestamp_timeout = 0