I normally do not used sudo, so am no expert at all, I did install it sometime ago, trying to help someone else , and I needed to have it installed so I could try some things, mine is basically default, other then when I added myself to sudoers. So any way, what you show is far from being default anymore, and seems to be missing a lot of things, combined with your moving and changing other files,...I think you have made a rather big mess, and should restore everything to default, use the back up you made before mucking around, (hope you made one)
One thing:
there was no sudo/ts in there so I su'd to root and created them.
The files in
Code: Select all
garry# pwd
/var/run/sudo/ts
garry# less garry
"garry" may be a binary file. See it anyway?
Those files are binary files,
So what you did, "there was no sudo/ts in there so I su'd to root and created them", is NOT the correct way to do that, and would not work.
Looked and they were set to be created in /var/lib rather than /var/run so I changed that and rebooted.
Good grief, so you need to change that back to the way it was as well,... and so on, it really is confusing as to what all you have done.
I just logged in as root, cd /etc, and used visudo, and added the line:
Code: Select all
Defaults env_reset,timestamp_timeout=6
saved and exited, and it works just fine, if I use sudo again in less then 6 min, I don't need a password.
Here is what my default sudoers file looks like, as you can see, yours is missing a lot:
Code: Select all
sudo grep Defaults /etc/sudoers
# Defaults specification
Defaults env_keep +="FTPMODE PKG_CACHE PKG_PATH SM_PATH SSH_AUTH_SOCK"
Defaults env_reset,timestamp_timeout=6
Defaults:%wsrc env_keep +="DESTDIR DISTDIR FETCH_CMD FLAVOR GROUP MAKE MAKECONF"
Defaults:%wsrc env_keep +="MULTI_PACKAGES NOMAN OKAY_FILES OWNER PKG_DBDIR"
Defaults:%wsrc env_keep +="PKG_DESTDIR PKG_TMPDIR PORTSDIR RELEASEDIR SHARED_ONLY"
Defaults:%wsrc env_keep +="SUBPACKAGE WRKOBJDIR SUDO_PORT_V1"
#Defaults env_keep +="ftp_proxy http_proxy"
#Defaults !lecture
#Defaults:%wheel !env_reset
Note, where it says:
Defaults env_reset,timestamp_timeout=6 But it could be 5 , 10, 15 , whatever.
I spent way more time on this then I should have,
I did also take a look at various manuals,and tutorials, did a search , and NONE of them say anything about doing this:
So I guessed that sudo creates the timestamps in /var/lib/sudo/ts but looks in /var/run/sudo/ts for it. Copied the file to the /var/run/sudo/ts directory and switched to the regular sudoer - no change.
So you gessed wrong, you need to restore everything to default and try again, sorry
===== edited ===
I followed this very straightforward and simple guide,
http://linuxg.net/change-sudo-password-timeout/
And it worked just fine, I will admit, since I am not very good with the "vi" editor, nor "visudo", I did munge the line on the first try, and was give a warning that there was a syntex error, close to line 23,
so I exited with out saving the change, on the second try it saved fine, and works fine. NO NEED to be creating files and directories , nor moving other things around. It is important that you use "visudo" and
not just any random editor though, also you must run it as root.