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 'ياسين
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityI 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 'ياسين
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.
useradd -m yaseen
and then edit the user name back to 'ياسين' inside/etc/passwd
withvipw
(just tried it centos7 -- whereuseradd
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