Find the answer to your Linux question:
Results 1 to 5 of 5
Hi, I see that SLES11 SP1 has a restriction to newely created username that cannot begin with numbers (only letter and underscore is allowed as first character). If I need ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2009
    Posts
    5

    username constraint


    Hi,

    I see that SLES11 SP1 has a restriction to newely created username that cannot begin with numbers (only letter and underscore is allowed as first character).
    If I need to create a username begining with number is there any workaround to make Linux to accept it?

    My second question is more general: is there any Linux distribution which supports CJK characters in usernames ?

    Thanks in advance !

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,753
    This is not an SLES issue, but one with the default Linux/Unix user account limitations. You might be able to use something like NIS or OpenLDAP for user authentication / directory purposes which may allow more flexible naming conventions. Ditto for CJK user names.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Quote Originally Posted by szycsi View Post
    I see that SLES11 SP1 has a restriction to newely created username that cannot begin with numbers (only letter and underscore is allowed as first character).
    If I need to create a username begining with number is there any workaround to make Linux to accept it?
    Is this a restriction only with a GUI, or does the terminal command also fail? e.g.:
    Code:
    useradd -g users 123user
    It works on my Fedora 15 box and my RHEL 4 box.

    Another hacky way to add a user would be to write a small bash script that adds the user line to /etc/passwd, then runs the pwconv utility (which will edit /etc/shadow for you, I think). Then run the passwd utility with the --stdin option, so you can script the setting of the user's default password. Also, you could have the script create home directories, etc.

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Jul 2009
    Posts
    5
    Yes, this mechanism we use in our product, but current implementation is so that once the user stored in remote LDAP server is successfully authenticated then we create a linux user with the same user name as it is stored on the LDAP. I even don't know if it is possible to authenticate successfully against the remote LDAP server and let login to linux machine without creating a linux user ? At least this is not the situation in our case
    So for this reason I'm searching for the solution to create somehow a username with the same name as it might be stored on the LDAP (cyrillic or cjk).
    But even would be satisfied with an answer that has anybody seen linux which support cjk usernames ? Or cyrillic ?

  6. #5
    Just Joined!
    Join Date
    Jul 2009
    Posts
    5
    You're righ: I've also tried on a RHEL4 machine and works fine to add a user begining with numbers in th username, however this is not supported in SLED/S 11.
    But what you suggested (hack the /etc/passwd then pwconf) works fine.
    Thanks !

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •