Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Using dots in username

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
josedias
Posts: 1
Joined: 2024-04-23 09:26

Using dots in username

#1 Post by josedias »

Hello,

I have a few debian machines and want to grant access to multiple users.

My question is: can I include dots in usernames like john.doe ?
Will it corrupt any service or something identical?


Thanks in advance.

User avatar
wizard10000
Global Moderator
Global Moderator
Posts: 672
Joined: 2019-04-16 23:15
Location: southeastern us
Has thanked: 89 times
Been thanked: 110 times

Re: Using dots in username

#2 Post by wizard10000 »

Usernames must conform to IEEE 1003.1-2001; legal characters are letters, digits, underscores, periods, at signs (@) and dashes but the username may not *start* with a dash.

There used to be an issue with systemd and periods in usernames but that has been resolved.

Hope this helps -
we see things not as they are, but as we are.
-- anais nin

Aki
Global Moderator
Global Moderator
Posts: 3086
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 76 times
Been thanked: 418 times

Re: Using dots in username

#3 Post by Aki »

Hello,
josedias wrote: 2024-04-23 09:48 My question is: can I include dots in usernames like john.doe ?
As @wizard10000 reported, according user manual of useradd command [1]:

Code: Select all

NOTES
   VALID NAMES
       Historically,  adduser(8)  and addgroup(8) enforced conformity to IEEE Std 1003.1-2001, which allows only the fol‐
       lowing characters to appear in group- and usernames: letters, digits,  underscores,  periods,  at  signs  (@)  and
       dashes.   The name may not start with a dash or @.  The "$" sign is allowed at the end of usernames to allow typi‐
       cal Samba machine accounts.
According to [2]:
[..]
Debian/Ubuntu based systems enforce the regular expression ^[a-z][-a-z0-9]*$, i.e. only lower case ASCII letters, digits and hyphens. As first character only lowercase ASCII letters are allowed. This regular expression is configurable by the administrator at runtime though. This rule enforces a minimum length of one character but no maximum length.
[..]
Combining all rules listed above, user/group names that shall be considered valid in all systemd contexts and on all Linux systems should match the following regular expression (at least according to our understanding):

Code: Select all

^[a-z][a-z0-9-]{0,30}$
Therefore, the "." character should not be supported by systemd.

If you try to add the user john.doe, the adduser program complains about the "." character:

Code: Select all

# adduser john.doe
adduser: Please enter a username matching the regular expression
            configured via the NAME_REGEX configuration variable.  Use the
            `--allow-bad-names' option to relax this check or reconfigure
            NAME_REGEX in configuration.
The defaut NAME_REGEX regex expression (used to check for user names) in /etc/adduser.conf (used by useradd command) shows:

Code: Select all

# grep -r NAME_REGEX /etc/adduser.conf
# Default: NAME_REGEX="^[a-z][-a-z0-9_]*\$?$"
#NAME_REGEX="^[a-z][-a-z0-9_]*\$?$"
# Default: SYS_NAME_REGEX="^[a-z_][-a-z0-9_]*\$?$"
#SYS_NAME_REGEX="^[a-z_][-a-z0-9_]*\$?$"
Therefore, it looks that "." in not allowed by default.

You can force it, but results could be unpredictable. This is coherent with the next part of the "VALID NAMES" paragraph of the adduser command (see [1]).

Hope this helps.

--
[1] adduser.conf
[1] Systemd - User/Group Name Syntax
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

User avatar
wizard10000
Global Moderator
Global Moderator
Posts: 672
Joined: 2019-04-16 23:15
Location: southeastern us
Has thanked: 89 times
Been thanked: 110 times

Re: Using dots in username

#4 Post by wizard10000 »

Aki wrote: 2024-04-23 16:15Therefore, it looks that "." in not allowed by default.
I stand corrected. Thanks, Aki :)
we see things not as they are, but as we are.
-- anais nin

User avatar
donald
Debian Developer, Site Admin
Debian Developer, Site Admin
Posts: 1131
Joined: 2021-03-30 20:08
Has thanked: 189 times
Been thanked: 249 times

Re: Using dots in username

#5 Post by donald »

@Best_Threads
Typo perfectionish.


"The advice given above is all good, and just because a new message has appeared it does not mean that a problem has arisen, just that a new gremlin hiding in the hardware has been exposed." - FreewheelinFrank

Post Reply