1

On a server, I have mounted a big drive on /home2 in order to store all the user accounts.

Supposedly in order to set the default directory to /home2, we are supposed to edit /etc/default/useradd

Inside is a line (commented out)

#HOME=/home

which I change to:

HOME=/home2

Yet subsequently, useradd -m continues to create users home directories in /home. For the moment, I just mounted the new drive as /home, and that did work obviously.

Can anyone tell me what I am doing wrong?

Zanna
  • 69,223
  • 56
  • 216
  • 327
Dov
  • 763
  • 1
  • 7
  • 18
  • 2
    Possible duplicate of [Move home folder to second drive](https://askubuntu.com/questions/21321/move-home-folder-to-second-drive) – mikewhatever Aug 04 '17 at 17:54
  • Did you uncomment the line in the `/etc/default/useradd` when you made the change to it? – Terrance Aug 04 '17 at 17:55
  • Show us a `diff /etc/default/useradd useradd.backup`. You did keep a backup of the only working copy you know of, right? – waltinator Aug 04 '17 at 19:48
  • nope. It's a brand new system, no one is on it, and it never occurred to me. And it's one line. I will have to do this Tuesday, I can't reach it now. – Dov Aug 05 '17 at 02:02
  • yes, I did uncomment the line #HOME=/home becomes HOME=/home2 – Dov Aug 05 '17 at 13:13
  • `adduser` seems to ignore the `useradd` setting. `useradd` uses the location specified in the configuration file but `adduser` simply ignores it – Felix B. Mar 11 '21 at 17:22

0 Answers0