sudo – what is it?

If you’ve been following my posts for a while, you will have also noticed the use of the sudo command in a lot of the Unix/Linux configuration and setup instructions. This is because of the security model used by these operating systems. Users generally have limited access, and only the ‘root’ or admin accounts has greater access. A common convention is to use the sudo command to allow for temporary (usually 5 minutes at a time) permission to make changes, using escalated rights for an existing non root user.

It’s often best to think of “sudo” as “mother may I”, as the server administrator can give users access to some (but not all) commands.

Permissions are stored in a file that can be edited in a variety of manners (do so carefully):
/etc/sudoers

To give an existing user permission to use sudo…

sudo adduser USERNAME sudo

REFERENCES:

Remove old Ubuntu kernels

If you update your Ubuntu kernel frequently, eventually you will come to the realization that it is taking a lot of space to keep the old versions around on disk. Another annoyance is that your Grub loader will show a very long list. Sure, you can keep them around forever, should you need to recover them, but for most people it’s safe to remove them. You can manually select and remove the packages in Synaptic, but the easiest way I’ve found is to sun the following script instead. It will remove all old kernel version (except the current one!):

dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge

Occasionally, you might also want to follow that with the following to clean up other artifacts too…
sudo apt-get autoremove

REFERENCES: