2

Should be a very simple question:

I'm on a FreeBSD server, running adduser asks for the home directory with a default in /home/username.

I'd like to not bother adding a home directory, but I would like the user to be able to ssh in - is it safe to set the home directory to be / or will it try to chmod it?

How do you say not to create a new directory?

1

As the FreeBSD adduser function does not seem to have a "don't create a home directory" option (via manpage), I would let FreeBSD create their home directory as normal, then simply delete it, and alter /etc/passwd to refer to /home as their home directory.

| improve this answer | |
3

A lot of accounts that come with FreeBSD use /nonexistent as a home directory. So, using pw, you could do

pw useradd myuser -d /nonexistent
| improve this answer | |
2

The command

 adduser -N

will skip the default configuration file for adduser, letting you specify anything you want. Something to watch out for is the default behavior of copying the skeleton files (/usr/share/skel) to the created home directory.

Watch out for bash/etc to complain when setting the homedir to '/' or something that doesn't have the dotfiles (.bashrc or whatever), or the permissions to write to .bash_history.

Other than that, creating it and pointing at / should be fine. You could also do what SirStan suggests - but again, watch out for shell issues/etc.

| improve this answer | |
0

Typically, you can use some sort of null device like /dev/null -- keep in mind that the user won't be able to login interactively on the terminal, but will otherwise be a user in the system.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy