1

I want to create Unicode logins for *Unix flavor OS, when i use useradd like below, I got that user name is invalid

[root@mail ~]# useradd ياسين
useradd: invalid user name 'ياسين
  • Related: unix.stackexchange.com/questions/340108/… – user147505 Oct 11 '19 at 21:12
  • Linux is one of the unix flavors and I could not add unix as a tag , that is why i use linux – Eng .. Abdalmonem Oct 11 '19 at 22:11
  • Deleted to avoid any confusions – Eng .. Abdalmonem Oct 11 '19 at 22:12
  • It works for me on debian 10 (buster). If you're using some ancient system, you could only use ascii, of course. – mosvy Oct 12 '19 at 9:25
  • 2
    Please mention the exact name and versions of the systems you're using. You may also try simply useradd -m yaseen and then edit the user name back to 'ياسين' inside /etc/passwd with vipw (just tried it centos7 -- where useradd rejects any non-ascii lowercase usernames). ssh, su, passwd should have no trouble dealing with the username afterwards. – mosvy Oct 13 '19 at 7:33
1

Check your systems documentation on what usernames are allowed. Eg.:

man useradd

On my Debian 10 in the section CAVEATS there I read this:

It is usually recommended to only use usernames that begin with a lower case letter or an underscore, followed by lower case letters, digits, underscores, or dashes. They can end with a dollar sign. In regular expression terms: [a-z_][a-z0-9_-]*[$]?

On Debian, the only constraints are that usernames must neither start with a dash ('-') nor plus ('+') nor tilde ('~') nor contain a colon (':'), a comma (','), 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.

  • I'm on linux mint, have the same section on man useradd, and I could create the user. – guillermo chamorro Oct 11 '19 at 21:13
  • @guillermochamorro Interesting. I've not tested on mine, just giving a hint. – user147505 Oct 11 '19 at 21:14
  • That is why I am asking how to create Unicode user not ASCII user !! – Eng .. Abdalmonem Oct 11 '19 at 22:09
  • @Eng..Abdalmonem If your system doesn't allow it then you can't. – user147505 Oct 12 '19 at 9:34
  • Is there a work around ? – Eng .. Abdalmonem Oct 12 '19 at 17:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.