DEV Community

Discussion on: Install and Deploy Docker in Raspberry Pi

Collapse
 
djstuder profile image
djstuder

First...
Great tutorial! Thanks!!
Second... a quick question...

TL;DR Why is the first character of the username capitalized when it causes an error to be thrown and the username to be rejected?

Please correct me if I'm wrong. The question is purely from curiosity, and asked with great respect. (IE: don't get irritated, I'm just curious.)

In this tutorial, the username is "P-42".
In Raspberry Pi 'buster version 10', this causes an error to be thrown. Interestingly, the error offers not one, but TWO potential solutions if you really want to override the system. It's possible, yet risky, and not advised. Bad things may happen!


pi@Rpi4:~ $ sudo adduser P-42
adduser: Please enter a username matching the regular expression configured
via the NAME_REGEX configuration variable. Use the `--force-badname'

option to relax this check or reconfigure NAME_REGEX.

Even the override option of '--force-badname' indicates that a username with a capital letter as the first character may not be a good idea!

My question... is there any particular reason that a capital letter is/was used for the username "P-42" even though the system throws an error unless you make accommodations for using the preferred username that starts with a capital letter?

Possible reasons that come to mind...

Was it done with the intention of "Always remember this!" teaching opportunity similar to tree command to list files in Linux, which of course returns everything cause EVERYTHING is a file in Linux?

When I was diving deeper on a Linux class project I came across the following...
Try the tree command with the -Q option to show the names of files in double quotes

tree -a -L 4 -R -q -l -F -Q

Coming from a Windows background, I was surprised at the results!
You'll always remember that in Linux, everything is a file. EVERYTHING !!
(I had a great and inspirational Linux class professor! )

Maybe it's a lot of nothing from when Linux was developed, an unneeded and forgotten holdover from Unix?

Maybe it's a default regex expression that was used and never changed? (haven't looked at that possibility or details yet.)

Maybe because it makes for easier reading of the screen? I always wondered why the default Raspberry Pi username is "pi" and not "Pi" .

Maybe it's like overclocking... It may or may not work. Try it and see. If you do try it, we're setting a bit saying you did what we told you not to do, and your warranty will be void. If your system fries, it's your fault and your problem.
( although 2.14 GHz CPU does make my Pi 4 a pretty responsive device ! )

Just trying to understand the intent of making the first letter of the username a capital letter when it seemingly appears to be ill-advised to do so. (That reminds me... I need to get more liquid nitrogen. )

Appreciated any appropriate response or feedback.

Collapse
 
project42 profile image
Project-42

Hi! not sure why I never get comments notifications here :)

I'm not 100% sure about the user.. I have the feeling I just replaced my "real" username for P-42 just for the post :) but really went into a nice rabbit hole there!!, I love it.

So, the only reason to use P-42 was to match the Blog name... nothing else. Now I feel a bit guilty and I'm sure you feel disappointed.. but hey.. the idea was to create a blog and learn things, and I'm sure we both this.. so THANK YOU!!!