groupadd, useradd, usermod not persistent after reboot

1,353 views
Skip to first unread message

Daniel Kho

unread,
Mar 3, 2016, 9:52:35 AM3/3/16
to Alt-F
Hi,

I bumped into something today. When adding new users and groups from the command line, I went back to the webUI just to save the settings. However, after a reboot of the box, these settings are not persistent.
How do I make useradd, usermod, and groupadd changes persistent after a reboot? By the way, is there a command-line version of the webUI "Save Settings" feature?

I did something like this:

sudo groupadd dev;

sudo usermod -l user-name1 username
sudo usermod -g dev user-name1;

sudo useradd -g dev     user-name2;

sudo usermod -a -G users        user-name1;
sudo usermod -a -G users        user-name2;

Previously I have created all the required user directories already, and these are persistent:
sudo mkdir /home/user-name1;
sudo mkdir /home/user-name2;

- dan

João Cardoso

unread,
Mar 3, 2016, 11:48:49 AM3/3/16
to Alt-F


On Thursday, 3 March 2016 14:52:35 UTC, Daniel Kho wrote:
Hi,

I bumped into something today. When adding new users and groups from the command line,

And what happens if you create them using the Setup->Users webUI?
In which filesystem is the Alt-F folder? A plain non-encrypted filesystem?
And where is the 'Users' folder? Alt-F keeps the users homedir in a folder called 'Users' that is linked to /home when the filesystem is discovered during hotplugging.
 
I went back to the webUI just to save the settings.

You can use 'loadsave_settings' from the command line, try it just to see its usage.
 
However, after a reboot of the box, these settings are not persistent.

Settings are stored in flash, and loaded into the root filesystem (in memory) at boot time; when the 'Alt-F' folder is discovered during disk hotplug it starts being used, shadowing the corresponding files and folders from the root (memory based) filesystem.
 
How do I make useradd, usermod, and groupadd changes persistent after a reboot? By the way, is there a command-line version of the webUI "Save Settings" feature?

Use 'loadsave-settings'.

The box "identity" is stored in flash, not disk, so that you can swap disks at will. There are some limitations on this original design, which was originated by the fact that hot swapping disks was mechanically easy to do on the DNS-321/323/325; that is not true anymore on the new 320L/327L, although you can still hot-plug/remove disks.
So you can't think of Alt-F as a classical disk-based linux distro.

Daniel Kho

unread,
Mar 4, 2016, 10:36:17 AM3/4/16
to Alt-F


On Friday, 4 March 2016 00:48:49 UTC+8, João Cardoso wrote:


On Thursday, 3 March 2016 14:52:35 UTC, Daniel Kho wrote:
Hi,

I bumped into something today. When adding new users and groups from the command line,

And what happens if you create them using the Setup->Users webUI?
In which filesystem is the Alt-F folder? A plain non-encrypted filesystem?
And where is the 'Users' folder? Alt-F keeps the users homedir in a folder called 'Users' that is linked to /home when the filesystem is discovered during hotplugging.
 
I remember setting up users worked before (from the webUI) when I did not set up encryption. Now, I remember trying both from webUI and command line, but both did not work.
I decided then to stick myself with using the command line, so I can do things like assigning a user's primary group to a custom group which I have added (using the -g switch), e.g.
useradd -g customgroup user-name1;

You may ask me why I want to do this. I'd say well, I didn't think of it at first, but since I'm already at the command line and the webUI didn't work, I might as well just do this for added security.
I have set up a folder where only users from this custom group can access. If someone added another user from the webUI, that user will by default belong to the primary group "users", and any
such user will not have access to this folder, unless I manually change the primary group of that user of course.

I checked that by default, useradd will create the user home folder under /mnt/<label-of-md0>/Users/<user-name1>. In my case, it is /mnt/os/Users, where "os" is the label of my unencrypted RAID partition /dev/md0 (/dev/sda2 + /dev/sdb2).
Yes, this folder is also mapped to /home.
Currently, I have a few users under /home (and /mnt/os/Users), but they will disappear after I reboot.
 
I went back to the webUI just to save the settings.

You can use 'loadsave_settings' from the command line, try it just to see its usage.

Thanks, I will try this next Monday.
 
However, after a reboot of the box, these settings are not persistent.

Settings are stored in flash, and loaded into the root filesystem (in memory) at boot time; when the 'Alt-F' folder is discovered during disk hotplug it starts being used, shadowing the corresponding files and folders from the root (memory based) filesystem.
 
How do I make useradd, usermod, and groupadd changes persistent after a reboot? By the way, is there a command-line version of the webUI "Save Settings" feature?

Use 'loadsave-settings'.

The box "identity" is stored in flash, not disk, so that you can swap disks at will. There are some limitations on this original design, which was originated by the fact that hot swapping disks was mechanically easy to do on the DNS-321/323/325; that is not true anymore on the new 320L/327L, although you can still hot-plug/remove disks.
So you can't think of Alt-F as a classical disk-based linux distro.

Yes, I like the idea that the most basic settings and minimal kernel was stored in Flash. So I will not be worried I lose the Alt-F firmware if both my hard disks failed, or if I made a mistake by writing wrong stuff into any of those hard disks. :)
By the way, I am using the DNS-320, which I think isn't difficult to hot-swap, did that several times before... :) Not sure about the differences between 320 and 320L...
 

I did something like this:

sudo groupadd dev;

sudo usermod -l user-name1 username
sudo usermod -g dev user-name1;

sudo useradd -g dev     user-name2;

sudo usermod -a -G users        user-name1;
sudo usermod -a -G users        user-name2;

Previously I have created all the required user directories already, and these are persistent:
sudo mkdir /home/user-name1;
sudo mkdir /home/user-name2;

- dan

- dan

Daniel Kho

unread,
Mar 7, 2016, 4:54:48 AM3/7/16
to Alt-F
This works, thanks!


On Friday, 4 March 2016 00:48:49 UTC+8, João Cardoso wrote:
 
How do I make useradd, usermod, and groupadd changes persistent after a reboot? By the way, is there a command-line version of the webUI "Save Settings" feature?

Use 'loadsave-settings'.

- dan
Reply all
Reply to author
Forward
0 new messages