How to allow dots in username

Description of my issue

I would like to know, if its possible to allow dots in usernames at yunohost. Everytime i would create a User i’m only allowed to use alphanumeric characters and the underscore sign. Can I change this behaviour?

Best regards for helping me out :slight_smile:

cnc13

My YunoHost server

Hardware: VPS bought online
YunoHost version: 3.8.0
I have access to my server : Through SSH and through the webadmin
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no

Hello,

Unfortunately this is not possible, sorry. Having a dot within the username would break plenty of programs and scripts that could use dots as separators (you can search the Internet for “debian dots in username” to have an idea how bad it can get).

that’s not true…
often people think chown can’t handle this… but it can handle users with dots…

even systemd adapted to allow dots:

when integrating yunohost with other systems this just sucks…

Confirm dot in username is not an issue. I used a debian server since 2003 and my username “dr.wily” never cause any bug.

Today I want to migrate my old server to a new one who use Yunohost but I can’t copy account because ynuhost refuse dot in username…

This limitation is here since almost 2016. I think probably older (like yunohost 2.x in 2012). We are using the same limitation than the regex in /etc/adduser.conf … So the same than debian and ubuntu.

chown command still accepts dot as separator. So yes if you use column separator it’s going well, but what about things like: chown $myuser /home/$myuser if myuser var contains a dot and is craftable it could trigger some problems.

Maybe. However, Yunohost offers more than 350 apps. I will be very suprized if all this apps are posix compliant… A small search about LDAP and dot gives me several bug related to those dot on several apps in our catalog.

So the question is should we change that to be posix compliant at risk to get unwanted bug report (difficult to understand cause username are redacted)… We have here pros and cons.

If you want you can do your test by adding a dot in this regex:

You might change the default regex in /etc/adduser.conf too.

Other funny things to manage with dot in username:
sudo - A dot in the linux username causes: "Username is not in the sudoers file. This incident will be reported." - Unix & Linux Stack Exchange

Shouldn’t it be escaped, as in \. ?

Not inside brackets.

!!str ^[a-z0-9_.-]+$
1 Like