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
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
add a comment |
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
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
add a comment |
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
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
centos users
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
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._-]+
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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._-]+
add a comment |
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._-]+
add a comment |
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._-]+
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._-]+
answered yesterday
Stephen HarrisStephen Harris
26.8k35181
26.8k35181
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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