Quick Setup Notes for Debian

Some quick setup notes for Debian 8 (“Lennie”).

Add yourself to the sudoers group:

$ adduser USERNAME sudoers

Set up unattended security updates:

$ apt-get install unattended-upgrades
$ dpkg-reconfigure -plow unattended-upgrades

(Select ‘yes’ to the ‘Automatically download’ question.)

Install all tools for dev/package builds:

$ apt-get install gcc g++ make linux-headers-$(uname -r)

(Alternatively, installing build-essentials will give you all standard c/c++/make/dpkg libraries, although not the kernel headers.)

“Permission denied” CD-ROM error:

Optical drives and network mounts are often mounted read-only to boost security. One workaround is to run any executable file with dash, the Debian command interpreter:

$ sh /media/cdrom/autorun.sh

Alternatively, you can edit /etc/fstab and add the exec option:

#before
/dev/sr0        /media/cdrom0   udf,iso9660 user,noauto     0       0
#after
/dev/sr0        /media/cdrom0   udf,iso9660 user,noauto,exec     0       0

‘noauto’ means the CD-ROM can only be mounted explicitly (i.e., mount /dev/sr0 but not mount -a) and noauto has no effect on filesystem permissions. ‘user’ means the device can be mounted by a non-root user, and without exec being set explicitly, the user command defaults to noexec so the execute permission bit is ignored. Depending on your environment, you might consider just removing the user directive so that anyone attempting to run executables from an inserted disc will be prompted for the root password.

Note: Under Debian 8 (“Jessie”), due to changes in systemctl, tinkering with your fstab may cause your system to hang on bootup. The error per journalctl -xb will be:

debian systemd[222]: Failed at step EXEC spawning /bin/plymouth: No such file or directory

This has nothing to do with plymouth but is caused by overly permissive CD-ROM or NFS entries in fstab. In some not-very-thorough testing, I find that systemctl won’t allow booting without one of (noauto, noexec) being set for devices.

Loading

Leave a Reply

Your email address will not be published. Required fields are marked *