FIXED - NEMS 1.3 User Creation Issue

Found something amiss in NEMS? Confirm first that you are running the latest version, and then post your bug report here.
Post Reply
Kuesco
Junior Member
Posts: 8
Joined: Fri Nov 10, 2017 6:56 am

FIXED - NEMS 1.3 User Creation Issue

Post by Kuesco »

Hi, this could not be a bug but an improvement.

I was noticed that in NEMS 1.2.3 i was able to create a username with the first letter in capital (Kuesco).

I backed up config and created a new SD with NEMS 1.3 just to do a fresh install and test after the SSL and Migrator bugs was resolved.

This time, during user creation dialog i wrote Kuesco as username and nems-init complained about the username being not conformant and then the proccess shows some errors (can´t create www-data and don´t delete nagiosadmin between others).
In the end i can still go into Nagios Core using Kuesco as username, but login to webmin is not allowed.
nagiosadmin is still here but is not usable anymore.

If i try to SSH to the PI to re run nems-init i can´t login as nagiosadmin nor Kuesco nor PI users are SSH enabled or the passwords are not the defaults anymore.

If i use a username without capital letters (kuesco) all is fine.

Maybe nems-init can alert the user if the username you choose is not allowed or not conformant with NEMS needs?
Kuesco
Junior Member
Posts: 8
Joined: Fri Nov 10, 2017 6:56 am

RE: NEMS 1.3 User Creation Issue

Post by Kuesco »

Just to add a bit of clarity:

What i mean is: If i do a newer install burning a new image on SD and then use kuesco (without capitals) as username, the script runs fine.

Sorry if i generated some confussion.
User avatar
Robbie Ferguson
Posting Freak
Posts: 835
Joined: Wed Mar 07, 2012 3:23 pm
Location: Ontario, Canada
Contact:

RE: NEMS 1.3 User Creation Issue

Post by Robbie Ferguson »

Thanks for pointing this out.

Since NEMS 1.3 does away with the pi user and instead creates a Linux user of the name you specifiy, the username must conform to Linux standards (eg., must be lowercase). Previously this was not a requirement.

You are absolutely correct here though; I did not implement any kind of error-checking to warn users if their chosen username was no good, so you'd end up with a broken NEMS 1.3 deployment if you used a capital letter since you'd no longer be able to SSH to the device.

This is very much a bug, and I appreciate you reporting it.

I'll push out an update today.

Thank you!
Robbie
Robbie Ferguson // The Bald Nerd

Did I help you out? Appreciate what I do? Please consider saying thanks:
User avatar
Robbie Ferguson
Posting Freak
Posts: 835
Joined: Wed Mar 07, 2012 3:23 pm
Location: Ontario, Canada
Contact:

RE: NEMS 1.3 User Creation Issue

Post by Robbie Ferguson »

Okay, I've added a dual-factor validation process: first it checks to make sure it's all lowercase. If yes, it'll also check to make sure it conforms to other requirements (eg., no dashes) before allowing the user to proceed.

https://github.com/Cat5TV/nems-scripts/ ... 75747d84cb

Thanks again for pointing out the bug!

Robbie
Robbie Ferguson // The Bald Nerd

Did I help you out? Appreciate what I do? Please consider saying thanks:
Post Reply