Stop Telling sudo Your Password
If you get tired of typing your password for sudo, but you don't want (or don't have permissions) to put NOPASSWD in your sudoers file, you can use the following procedure to update the sudo password timestamp and avoid typing your password.
Step 1) Create $HOME/bin/sudo-hack.sh:
#!/bin/bash while [ true ]; do sudo -u root /bin/true > /dev/null 2> /dev/null sleep 60 done
Step 2) Do an initial run of sudo to set its password timestamp:
$ sudo -u root /bin/true Password: *******
Step 3) Start $HOME/bin/sudo-hack.sh in the background:
$ HOME/bin/sudo-hack.sh &
Now you can use sudo without getting a password prompt, regardless of how long it's been since the last time you ran sudo.
Note: there are most certainly security implications related to using this procedure; of course, that's also true of using NOPASSWD in the sudoers file.
- Papa's Got a Brand New NAS
- Applied Expert Systems, Inc.'s CleverView for TCP/IP on Linux
- Returning Values from Bash Functions
- Panther MPC, Inc.'s Panther Alpha
- Simplenote, Simply Awesome!
- Tech Tip: Really Simple HTTP Server with Python
- Rogue Wave Software's TotalView for HPC and CodeDynamics
- NethServer: Linux without All That Linux Stuff
- GENIVI Alliance's GENIVI Vehicle Simulator
- Jetico's BestCrypt Container Encryption for Linux