<div dir="auto">Iirc systemd refused usernames starting with a number. There was a huge discussion in the systemd bugtracker but I don't remeber the outcome anymore.<div dir="auto"><br></div><div dir="auto">Part of the problem is that commands accept both usernames and userid AS parameters and there just be some clear way to distinguish those two.</div><div dir="auto"><br></div><div dir="auto">I suggest checking the systemd bugtracker before starting another discussion here ;-) See here: <a href="https://github.com/systemd/systemd/issues/6237">https://github.com/systemd/systemd/issues/6237</a></div><div dir="auto"><br></div><div dir="auto">Uli</div></div><div class="gmail_extra"><br><div class="gmail_quote">Am 24.10.2017 21:42 schrieb "Norman Gray" <<a href="mailto:gray@nxg.name">gray@nxg.name</a>>:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Greetings.<br>
<br>
[I'm happy to submit this as a bug at <a href="http://bugs.x2go.org" rel="noreferrer" target="_blank">bugs.x2go.org</a>, but <<a href="https://wiki.x2go.org/doku.php/wiki:bugs" rel="noreferrer" target="_blank">https://wiki.x2go.org/doku.ph<wbr>p/wiki:bugs</a>> recommends discussing potential bugs here beforehand]<br>
<br>
At present, x2goserver sanitises usernames with a regexp in <a href="http://x2goutils.pm" rel="noreferrer" target="_blank">x2goutils.pm</a> and in <a href="http://x2gosqlitewrapper.pl" rel="noreferrer" target="_blank">x2gosqlitewrapper.pl</a> (same in both places).  That's:<br>
<br>
    if ($string =~ /^([a-zA-Z\_][a-zA-Z0-9\_\-\.\<wbr>@]{0,47}[\$]?)\-([\d]{2,4})\-(<wbr>[\d]{9,12})\_[a-zA-Z0-9\_\-\.]<wbr>*\_dp[\d]{1,2}$/) {<br>
<br>
A username of, eg, '1234567x' fails this test.  I believe such a username should not fail.<br>
<br>
  * POSIX/Single Unix says of the username simply "To be portable across systems conforming to POSIX.1-2008, the value is composed of characters from the portable filename character set. The <hyphen-minus> character should not be used as the first character of a portable user name." (see <<a href="http://pubs.opengroup.org/onlinepubs/9699919799/" rel="noreferrer" target="_blank">http://pubs.opengroup.org/onl<wbr>inepubs/9699919799/</a>>, paragraph 3.437)<br>
<br>
  * The Debian useradd(8) page recommends something matching /^[a-z_][a-z0-9_-]*$/, but goes on to say "On Debian, the only constraints are that usernames must neither start with a dash ('-') nor contain a colon (':') or a whitespace (space: ' ', end of line: '\n', tabulation: '\t', etc.). Note that using a slash ('/') may break the default algorithm for the definition of the user's home directory." (see eg <<a href="https://www.unix.com/man-page/linux/8/useradd/" rel="noreferrer" target="_blank">https://www.unix.com/man-page<wbr>/linux/8/useradd/</a>>)<br>
<br>
  * The corresponding RedHat/CentOS manpage doesn't even include that, and instead says only "Usernames may only be up to 32 characters long."  FreeBSD is similarly laid-back about the username.<br>
<br>
I myself think that a username like '1234567x' is asking for at least a little bit of trouble, but those are the networked usernames I'm having to deal with, so that trouble is not of my asking.  Also, I suspect that the trailing character is there precisely in order to avoid this matching /^[0-9]+$/, and thus to be interpretable as a number.<br>
<br>
This does appear to be the source of my login problems, since if I hack the two files above, to have the regexp start with [a-zA-Z0-9\_], then my users can log in without difficulty.  This hacking is obviously not a great solution.<br>
<br>
This issue was discussed on the user list a little while ago <<a href="http://lists.x2go.org/pipermail/x2go-user/2015-April/003161.html" rel="noreferrer" target="_blank">http://lists.x2go.org/piperma<wbr>il/x2go-user/2015-April/<wbr>003161.html</a>> (that's what gave me the aha!).  There, Mihai Moldovan said "That's non-standard-compliant and you're basically on your own when doing "funky stuff"."  To be clear, I think such usernames are less than ideal, but I don't think they count as funky or non-compliant.<br>
<br>
----<br>
<br>
As a distinct but related matter, when a failing username is rejected by this test, the session doesn't fail, but simply seems to hang, giving no feedback about the problem, nor, as far as I can see, reporting anything in the logs.  Whatever the decision about this report, it would be useful to fail in a more communicative way.<br>
<br>
I'd be interested in your views.<br>
<br>
Best wishes,<br>
<br>
Norman<font color="#888888"><br>
<br>
<br>
-- <br>
Norman Gray  :  <a href="https://nxg.me.uk" rel="noreferrer" target="_blank">https://nxg.me.uk</a><br>
______________________________<wbr>_________________<br>
x2go-dev mailing list<br>
<a href="mailto:x2go-dev@lists.x2go.org" target="_blank">x2go-dev@lists.x2go.org</a><br>
<a href="https://lists.x2go.org/listinfo/x2go-dev" rel="noreferrer" target="_blank">https://lists.x2go.org/listinf<wbr>o/x2go-dev</a></font></blockquote></div><br></div>