Locking down users’ home directories the Debian/Ubuntu way
Debian and its offspring, such as Ubuntu, have two user creation utilities:
useradd
adduser
Let’s look at both of them.
useradd on Debian/Ubuntu
The useradd
utility is there, but Debian and Ubuntu don’t come with handy preconfigured defaults as the Red Hat-type distros do. If you were to just do sudo useradd frank
on a Debian/Ubuntu machine, Frank would have no home directory and would be assigned the wrong default shell. So, to create a user account with useradd
on a Debian or Ubuntu system, the command will look something like this:
sudo useradd -m -d /home/frank -s /bin/bash frank
Here’s a breakdown of what all this means:
- -m creates the home directory.
- -d specifies the home directory.
- -s specifies Frank’s default shell. (Without the
-s
, Debian/Ubuntu would assign to Frank the/bin/sh
shell.)
When you look at the...