Valid special characters allowed in a CentOS 7 username?2019 Community Moderator ElectionWhy can't Linux usernames begin with numbers?Why are underscores not allowed in usernames in some distros (Debian for example)How can I fix “cannot find a valid baseurl for repo” errors on CentOS?Seem to be having a problem with RealVNC with centos can't input usernameChanging username but not home directorychange root account usernameHyphen's availability in UNIX usernameCentOS: yum update Cannot find a valid baseurl for repoCentos device /dev/sdb1 is not a valid luks device?Environment USER and USERNAME in CentOS 7How to configure which characters are allowed in CentOS usernames

Quoting Keynes in a lecture

What is Cash Advance APR?

Is it allowed to activate the ability of multiple planeswalkers in a single turn?

Will number of steps recorded on FitBit/any fitness tracker add up distance in PokemonGo?

How to explain what's wrong with this application of the chain rule?

What are some good ways to treat frozen vegetables such that they behave like fresh vegetables when stir frying them?

Is this part of the description of the Archfey warlock's Misty Escape feature redundant?

Why do Radio Buttons not fill the entire outer circle?

Why is so much work done on numerical verification of the Riemann Hypothesis?

How to make money from a browser who sees 5 seconds into the future of any web page?

Doesn't the system of the Supreme Court oppose justice?

Taxes on Dividends in a Roth IRA

Why does AES have exactly 10 rounds for a 128-bit key, 12 for 192 bits and 14 for a 256-bit key size?

"It doesn't matter" or "it won't matter"?

How do you make your own symbol when Detexify fails?

Can you use Vicious Mockery to win an argument or gain favours?

Why is it that I can sometimes guess the next note?

Has any country ever had 2 former presidents in jail simultaneously?

It grows, but water kills it

Why does the Sun have different day lengths, but not the gas giants?

A Trivial Diagnosis

Does "he squandered his car on drink" sound natural?

Why is the "ls" command showing permissions of files in a FAT32 partition?

Are Captain Marvel's powers affected by Thanos breaking the Tesseract and claiming the stone?



Valid special characters allowed in a CentOS 7 username?



2019 Community Moderator ElectionWhy can't Linux usernames begin with numbers?Why are underscores not allowed in usernames in some distros (Debian for example)How can I fix “cannot find a valid baseurl for repo” errors on CentOS?Seem to be having a problem with RealVNC with centos can't input usernameChanging username but not home directorychange root account usernameHyphen's availability in UNIX usernameCentOS: yum update Cannot find a valid baseurl for repoCentos device /dev/sdb1 is not a valid luks device?Environment USER and USERNAME in CentOS 7How to configure which characters are allowed in CentOS usernames










0















I'm trying to figure out how CentOS 7 identifies what is considered a valid character in a naming convention when a user account is created.



I was playing around with useradd to confirm my understanding of what CentOS considered valid characters in a user name.... and to my surprise the useradd command accepted '_' and '.'... Which got me wondering where valid/invalid characters are established in CentOS



The useradd man page in CentOS doesn't mention valid characters... And google searches said this is done with NAME_REGEX (For ubuntu at least)... and had me looking for it in a adduser.conf file... which does not exist in CentOS 7... I haven't been able to locate a CentOS/Red Hat specific source on google about this... But I've also looked in /etc/login.defs and /etc/default/useradd with no luck



Can anyone direct me to the mechanism in CentOS does this?










share|improve this question



















  • 1





    Related, over at SO (for whatever reason): What are the real rules for linux usernames on CentOS 6 and RHEL 6?

    – Kusalananda
    yesterday











  • Relating unix.stackexchange.com/q/287077/117549

    – Jeff Schaller
    yesterday















0















I'm trying to figure out how CentOS 7 identifies what is considered a valid character in a naming convention when a user account is created.



I was playing around with useradd to confirm my understanding of what CentOS considered valid characters in a user name.... and to my surprise the useradd command accepted '_' and '.'... Which got me wondering where valid/invalid characters are established in CentOS



The useradd man page in CentOS doesn't mention valid characters... And google searches said this is done with NAME_REGEX (For ubuntu at least)... and had me looking for it in a adduser.conf file... which does not exist in CentOS 7... I haven't been able to locate a CentOS/Red Hat specific source on google about this... But I've also looked in /etc/login.defs and /etc/default/useradd with no luck



Can anyone direct me to the mechanism in CentOS does this?










share|improve this question



















  • 1





    Related, over at SO (for whatever reason): What are the real rules for linux usernames on CentOS 6 and RHEL 6?

    – Kusalananda
    yesterday











  • Relating unix.stackexchange.com/q/287077/117549

    – Jeff Schaller
    yesterday













0












0








0








I'm trying to figure out how CentOS 7 identifies what is considered a valid character in a naming convention when a user account is created.



I was playing around with useradd to confirm my understanding of what CentOS considered valid characters in a user name.... and to my surprise the useradd command accepted '_' and '.'... Which got me wondering where valid/invalid characters are established in CentOS



The useradd man page in CentOS doesn't mention valid characters... And google searches said this is done with NAME_REGEX (For ubuntu at least)... and had me looking for it in a adduser.conf file... which does not exist in CentOS 7... I haven't been able to locate a CentOS/Red Hat specific source on google about this... But I've also looked in /etc/login.defs and /etc/default/useradd with no luck



Can anyone direct me to the mechanism in CentOS does this?










share|improve this question
















I'm trying to figure out how CentOS 7 identifies what is considered a valid character in a naming convention when a user account is created.



I was playing around with useradd to confirm my understanding of what CentOS considered valid characters in a user name.... and to my surprise the useradd command accepted '_' and '.'... Which got me wondering where valid/invalid characters are established in CentOS



The useradd man page in CentOS doesn't mention valid characters... And google searches said this is done with NAME_REGEX (For ubuntu at least)... and had me looking for it in a adduser.conf file... which does not exist in CentOS 7... I haven't been able to locate a CentOS/Red Hat specific source on google about this... But I've also looked in /etc/login.defs and /etc/default/useradd with no luck



Can anyone direct me to the mechanism in CentOS does this?







centos users






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited yesterday









Rui F Ribeiro

41.6k1483141




41.6k1483141










asked yesterday









BodishaBodisha

282




282







  • 1





    Related, over at SO (for whatever reason): What are the real rules for linux usernames on CentOS 6 and RHEL 6?

    – Kusalananda
    yesterday











  • Relating unix.stackexchange.com/q/287077/117549

    – Jeff Schaller
    yesterday












  • 1





    Related, over at SO (for whatever reason): What are the real rules for linux usernames on CentOS 6 and RHEL 6?

    – Kusalananda
    yesterday











  • Relating unix.stackexchange.com/q/287077/117549

    – Jeff Schaller
    yesterday







1




1





Related, over at SO (for whatever reason): What are the real rules for linux usernames on CentOS 6 and RHEL 6?

– Kusalananda
yesterday





Related, over at SO (for whatever reason): What are the real rules for linux usernames on CentOS 6 and RHEL 6?

– Kusalananda
yesterday













Relating unix.stackexchange.com/q/287077/117549

– Jeff Schaller
yesterday





Relating unix.stackexchange.com/q/287077/117549

– Jeff Schaller
yesterday










1 Answer
1






active

oldest

votes


















0














Note that useradd may be more restrictive than what is actually valid as a username. The rules as to what a valid username is may also change via PAM and nsswitch configuration settings.



The POSIX standard says that usernames must be from the "portable filename characterset" but the first character must not be a hyphen.



The portable filename character set are the characters A-Z a-z 0-9 . - _



Note this means that something like "1337" is a valid username according to this standard, which may cause issues elsewhere.



So, for safety, I would use a pattern such as [A-Za-z][A-Za-z0-9._-]+






share|improve this answer






















    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f507575%2fvalid-special-characters-allowed-in-a-centos-7-username%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Note that useradd may be more restrictive than what is actually valid as a username. The rules as to what a valid username is may also change via PAM and nsswitch configuration settings.



    The POSIX standard says that usernames must be from the "portable filename characterset" but the first character must not be a hyphen.



    The portable filename character set are the characters A-Z a-z 0-9 . - _



    Note this means that something like "1337" is a valid username according to this standard, which may cause issues elsewhere.



    So, for safety, I would use a pattern such as [A-Za-z][A-Za-z0-9._-]+






    share|improve this answer



























      0














      Note that useradd may be more restrictive than what is actually valid as a username. The rules as to what a valid username is may also change via PAM and nsswitch configuration settings.



      The POSIX standard says that usernames must be from the "portable filename characterset" but the first character must not be a hyphen.



      The portable filename character set are the characters A-Z a-z 0-9 . - _



      Note this means that something like "1337" is a valid username according to this standard, which may cause issues elsewhere.



      So, for safety, I would use a pattern such as [A-Za-z][A-Za-z0-9._-]+






      share|improve this answer

























        0












        0








        0







        Note that useradd may be more restrictive than what is actually valid as a username. The rules as to what a valid username is may also change via PAM and nsswitch configuration settings.



        The POSIX standard says that usernames must be from the "portable filename characterset" but the first character must not be a hyphen.



        The portable filename character set are the characters A-Z a-z 0-9 . - _



        Note this means that something like "1337" is a valid username according to this standard, which may cause issues elsewhere.



        So, for safety, I would use a pattern such as [A-Za-z][A-Za-z0-9._-]+






        share|improve this answer













        Note that useradd may be more restrictive than what is actually valid as a username. The rules as to what a valid username is may also change via PAM and nsswitch configuration settings.



        The POSIX standard says that usernames must be from the "portable filename characterset" but the first character must not be a hyphen.



        The portable filename character set are the characters A-Z a-z 0-9 . - _



        Note this means that something like "1337" is a valid username according to this standard, which may cause issues elsewhere.



        So, for safety, I would use a pattern such as [A-Za-z][A-Za-z0-9._-]+







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered yesterday









        Stephen HarrisStephen Harris

        26.8k35181




        26.8k35181



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f507575%2fvalid-special-characters-allowed-in-a-centos-7-username%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            getting Checkpoint VPN SSL Network Extender working in the command lineHow to connect to CheckPoint VPN on Ubuntu 18.04LTS?Will the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayVPN SSL Network Extender in FirefoxLinux Checkpoint SNX tool configuration issuesCheck Point - Connect under Linux - snx + OTPSNX VPN Ububuntu 18.XXUsing Checkpoint VPN SSL Network Extender CLI with certificateVPN with network manager (nm-applet) is not workingWill the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayImport VPN config files to NetworkManager from command lineTrouble connecting to VPN using network-manager, while command line worksStart a VPN connection with PPTP protocol on command linestarting a docker service daemon breaks the vpn networkCan't connect to vpn with Network-managerVPN SSL Network Extender in FirefoxUsing Checkpoint VPN SSL Network Extender CLI with certificate

            Cannot Extend partition with GParted The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election ResultsCan't increase partition size with GParted?GParted doesn't recognize the unallocated space after my current partitionWhat is the best way to add unallocated space located before to Ubuntu 12.04 partition with GParted live?I can't figure out how to extend my Arch home partition into free spaceGparted Linux Mint 18.1 issueTrying to extend but swap partition is showing as Unknown in Gparted, shows proper from fdiskRearrange partitions in gparted to extend a partitionUnable to extend partition even though unallocated space is next to it using GPartedAllocate free space to root partitiongparted: how to merge unallocated space with a partition

            Marilyn Monroe Ny fiainany manokana | Jereo koa | Meny fitetezanafanitarana azy.