Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

3 Answers 3

up vote 1 down vote accepted

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.

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.