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.
- Two Pi R
- Readers' Choice Awards 2013
- AIDE—Developing for Android on Android
- Best. Cake. Ever.
- The Geek's Guide to the Coolest 2013 Holiday Gifts
- A Handy U-Boot Trick
- Sublime Text: One Editor to Rule Them All?
- RSS Feeds
- Raspberry Pi: the Perfect Home Server
- Tech Tip: Really Simple HTTP Server with Python
- Baker's identity
2 hours 19 min ago
- Uber jealous
7 hours 17 min ago
- Reality is disapointing
17 hours 49 min ago
- Máy sấy quần áo
20 hours 35 min ago
- Services on GlusterFS
20 hours 45 min ago
- Reply to comment | Linux Journal
22 hours 25 min ago
- Definitely cool stuff here
23 hours 26 min ago
- thanks for the information
1 day 37 min ago
- nice information thanks
1 day 1 hour ago
1 day 4 hours ago