How I can make sudo Ubuntu 10.04 session an hour and not few minutes?
Now I have to write my password for sudo commands every few minutes.
Instead of making the sudo session longer, you could actually log in as root.
Anything you do afterwards is done as root. You don't even have to enter sudo anymore.
You can log out any time you want.
Disclaimer: This is not recommended for security reasons! One of the reasons why Linux is so safe are the user privileges.
You can edit the
sudo settings file with the following command:
And then change the line
x is in minutes by the way.
A negative value for
x such as -1 will cause sudo to ask for user password only once per session.
will apply the setting only to the named user.
One word of warning:
Do not edit this file with another editor/command! If you lock yourself out of your system, reboot into single-user/recovery mode and run
You can use pamusb.
"pam_usb provides hardware authentication for Linux using ordinary USB Flash Drives "
I prefer "sudo -i" after logging in as user.
The -i (simulate initial login) option runs the shell specified in the passwd(5) entry of the target user as a login shell. This means that login-specific resource files such as .profile or .login will be read by the shell. If a command is specified, it is passed to the shell for execution. Otherwise, an interactive shell is executed. sudo attempts to change to that user's home directory before running the shell. It also initializes the environment, leaving DISPLAY and TERM unchanged, setting HOME, SHELL, USER, LOGNAME, and PATH, as well as the contents of /etc/environment on Linux and AIX systems. All other environment variables are removed.