New Admin Account - Old System

mobrien118

Dabbler
Joined
Jun 22, 2020
Messages
25
I have an old TrueNAS Scale system that has been complaining about logging in as root. I appreciate the security objective and want to make use of a secondary admin.

I noticed that, on the upgraded system, there is already a "/home/admin/" path, even before the user exists, and its ownership is set to "950:950", which coincides with another system I have where "admin" was created upon install.

So, I decided to try to create an "admin" user on the "old" system identical to the "admin" on the "new", however, it won't let me set the user home to the already existing "/home/admin" giving the error:
Code:
"Home Directory" must begin with /mnt/ or set to /nonexistent.

I tried using "usermod" and editing "/etc/passwd" and "/etc/passwd-" but the changes don't stick...

I get that this isn't a huge deal, but I would like for it to be consistent - any way to "hack" it?
 

RadolBR

Cadet
Joined
Sep 4, 2023
Messages
8
What you mean with...
editing "/etc/passwd" and "/etc/passwd-"

You use vi editor or nano? If you use vi as editor, you need to overwrite the file with
:wq!

But is simple use passwd on console loged as root.
passwd admin
passwd does not require last password, just give a new.
 

mobrien118

Dabbler
Joined
Jun 22, 2020
Messages
25
Please note - I'm trying to change the home directory, not the password.
You use vi editor or nano? If you use vi as editor, you need to overwrite the file with
:wq!
Yes, but it doesn't withstand a reboot. I've been using vi(/m) for 20 years or so.
But is simple use passwd on console loged as root.
passwd admin
passwd does not require last password, just give a new.
Tried that, too. It didn't withstand a reboot, either, and now I'm getting this error when I even try to launch that command:
passwd: Authentication token manipulation error passwd: password unchanged
 

mobrien118

Dabbler
Joined
Jun 22, 2020
Messages
25
Figured it out.

From command prompt (assuming your admin user is UID 950):
Code:
% sudo sqlite3 /data/freenas-v1.db
[sudo] password for [you]: [Enter your password]
SQLite version 3.40.1 2022-12-28 14:03:47
Enter ".help" for usage hints.
sqlite>  update account_bsdusers set bsdusr_home = '/home/admin' where bsdusr_uid = 950 ;
sqlite> .exit
% exit
 
Top