Master Your Linux Keyboard (And Fix Caps Lock Forever) - page 4
Exorcising Caps Lock
su is "switch to a different user".
sudo is "execute a single command as another user, as configured in the
/etc/sudoers file." Ubuntu's clever use of
sudo is one of those "d'oh! Why didn't someone think of this years ago!" deals. Users who need occasional root privileges are simply added to the
sudo protects the root password and logs all activity. Ubuntu doesn't even create a root login during installation. But you really need a root login for a number of reasons: some commands do not know how to handle it when
sudo asks for a password, and it's more convenient when you have a lot of administrative chores to perform. Probably the most important reason to have a root login is the Ext2/3 filesystem reserves 5% of the filesystem for the root user. This gives you enough room to manuever and to rescue the system when some user process goes nuts and fills up your hard drive.
How do you make a root login on Ubuntu and all of its Buntu cousins? Easy, with
$ sudo passwd root
sudo is typically compiled with a 15-minute timeout, which means you can run a number of
sudo commands without re-entering your password in that time. You can this change per-user or per-group by editing
/etc/sudoers, which must be done with
$ sudo visudo $ Defaults:carla timestamp_timeout=30
Close and save with Ctrl-X and Y.
-1 makes it infinite. Don't do this, for obvious security reasons.
Because Ubuntu makes
gksudo both behave like
sudo, how do you configure
xbindkeys to run a command as "real" root? Use the
-w switch, like this:
$ gksu -w kate
You can cancel the
sudo timeout with this command:
$ sudo -k
This is helpful when you're testing your commands and they get stuck in
- 1Linux Top 3: Alpine Linux 3.4, deepin 15.2 and Linux Lite 3.0
- 2Linux 4.7 Set to Boost Live Patching, Security and Power Management
- 3Linux 4.6 Charred Weasel adds USB 3.1 Support
- 4Linux Top 3: OpenIndiana 2016.04, Ubuntu 16.04 and Debian's New Leader
- 5Linux Top 3: KaOS 2016.04, TurnKey 14.1 and pfSense 2.3