Page 1 of 1

FIXED - NEMS 1.3 User Creation Issue

Posted: Fri Nov 17, 2017 7:09 am
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?

RE: NEMS 1.3 User Creation Issue

Posted: Fri Nov 17, 2017 10:23 am
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.

RE: NEMS 1.3 User Creation Issue

Posted: Mon Nov 20, 2017 11:13 am
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

RE: NEMS 1.3 User Creation Issue

Posted: Mon Nov 20, 2017 11:36 am
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