How to add to group when name has a space?
Is it possible to add a name as a group member when the name has a space? For example "foo bars" is the name and I want it to add to the group called "reindeers".
This group is created in AD and it is quite common for names to have spaces. I won't be able to change the name.
Apologies if this has already been asked here. I just could not find any references. I did find solutions/discussions to adding a username with a space in the sudoers config file by replacing the space with a "_" instead, or escaping the space with a backslash. Not sure if this works with regards to adding it to a group.
Thanks,
Mrky
linux
|
show 1 more comment
Is it possible to add a name as a group member when the name has a space? For example "foo bars" is the name and I want it to add to the group called "reindeers".
This group is created in AD and it is quite common for names to have spaces. I won't be able to change the name.
Apologies if this has already been asked here. I just could not find any references. I did find solutions/discussions to adding a username with a space in the sudoers config file by replacing the space with a "_" instead, or escaping the space with a backslash. Not sure if this works with regards to adding it to a group.
Thanks,
Mrky
linux
Did you try "%20"?
– Ignacio Vazquez-Abrams
Nov 1 '17 at 4:19
1
You want to add a group (that has a space in it) into another group? How does that work on unix?
– thrig
Nov 1 '17 at 4:22
Won't "%20" be treated literally instead in this case?
– markyxyz
Nov 1 '17 at 4:24
@thrig I know, right? I can't even add a username like "foo bars" coz of restrictions. And even if I could, I would not do that. It's just bad practice. Alas, this is not just up to me. How do I explain this to clients? I want to exhaust all other options where possible before going back to them and probably get into an argument.
– markyxyz
Nov 1 '17 at 4:27
4
Why, for the sake of Church of Emacs, would somebody like to have a username (or group name) with space in it?
– cezar
Nov 1 '17 at 7:27
|
show 1 more comment
Is it possible to add a name as a group member when the name has a space? For example "foo bars" is the name and I want it to add to the group called "reindeers".
This group is created in AD and it is quite common for names to have spaces. I won't be able to change the name.
Apologies if this has already been asked here. I just could not find any references. I did find solutions/discussions to adding a username with a space in the sudoers config file by replacing the space with a "_" instead, or escaping the space with a backslash. Not sure if this works with regards to adding it to a group.
Thanks,
Mrky
linux
Is it possible to add a name as a group member when the name has a space? For example "foo bars" is the name and I want it to add to the group called "reindeers".
This group is created in AD and it is quite common for names to have spaces. I won't be able to change the name.
Apologies if this has already been asked here. I just could not find any references. I did find solutions/discussions to adding a username with a space in the sudoers config file by replacing the space with a "_" instead, or escaping the space with a backslash. Not sure if this works with regards to adding it to a group.
Thanks,
Mrky
linux
linux
edited Nov 1 '17 at 4:16
markyxyz
asked Nov 1 '17 at 4:00
markyxyzmarkyxyz
1814
1814
Did you try "%20"?
– Ignacio Vazquez-Abrams
Nov 1 '17 at 4:19
1
You want to add a group (that has a space in it) into another group? How does that work on unix?
– thrig
Nov 1 '17 at 4:22
Won't "%20" be treated literally instead in this case?
– markyxyz
Nov 1 '17 at 4:24
@thrig I know, right? I can't even add a username like "foo bars" coz of restrictions. And even if I could, I would not do that. It's just bad practice. Alas, this is not just up to me. How do I explain this to clients? I want to exhaust all other options where possible before going back to them and probably get into an argument.
– markyxyz
Nov 1 '17 at 4:27
4
Why, for the sake of Church of Emacs, would somebody like to have a username (or group name) with space in it?
– cezar
Nov 1 '17 at 7:27
|
show 1 more comment
Did you try "%20"?
– Ignacio Vazquez-Abrams
Nov 1 '17 at 4:19
1
You want to add a group (that has a space in it) into another group? How does that work on unix?
– thrig
Nov 1 '17 at 4:22
Won't "%20" be treated literally instead in this case?
– markyxyz
Nov 1 '17 at 4:24
@thrig I know, right? I can't even add a username like "foo bars" coz of restrictions. And even if I could, I would not do that. It's just bad practice. Alas, this is not just up to me. How do I explain this to clients? I want to exhaust all other options where possible before going back to them and probably get into an argument.
– markyxyz
Nov 1 '17 at 4:27
4
Why, for the sake of Church of Emacs, would somebody like to have a username (or group name) with space in it?
– cezar
Nov 1 '17 at 7:27
Did you try "%20"?
– Ignacio Vazquez-Abrams
Nov 1 '17 at 4:19
Did you try "%20"?
– Ignacio Vazquez-Abrams
Nov 1 '17 at 4:19
1
1
You want to add a group (that has a space in it) into another group? How does that work on unix?
– thrig
Nov 1 '17 at 4:22
You want to add a group (that has a space in it) into another group? How does that work on unix?
– thrig
Nov 1 '17 at 4:22
Won't "%20" be treated literally instead in this case?
– markyxyz
Nov 1 '17 at 4:24
Won't "%20" be treated literally instead in this case?
– markyxyz
Nov 1 '17 at 4:24
@thrig I know, right? I can't even add a username like "foo bars" coz of restrictions. And even if I could, I would not do that. It's just bad practice. Alas, this is not just up to me. How do I explain this to clients? I want to exhaust all other options where possible before going back to them and probably get into an argument.
– markyxyz
Nov 1 '17 at 4:27
@thrig I know, right? I can't even add a username like "foo bars" coz of restrictions. And even if I could, I would not do that. It's just bad practice. Alas, this is not just up to me. How do I explain this to clients? I want to exhaust all other options where possible before going back to them and probably get into an argument.
– markyxyz
Nov 1 '17 at 4:27
4
4
Why, for the sake of Church of Emacs, would somebody like to have a username (or group name) with space in it?
– cezar
Nov 1 '17 at 7:27
Why, for the sake of Church of Emacs, would somebody like to have a username (or group name) with space in it?
– cezar
Nov 1 '17 at 7:27
|
show 1 more comment
5 Answers
5
active
oldest
votes
Group and user names aren’t allowed to contain the space character on POSIX-style systems; see Command line login failed with two strings ID in Debian Stretch for references (the restrictions apply to groups as well as users).
In your case you might be able to work around the limitation by managing your groups in AD rather than in /etc/group
. But I’d recommend trying to convince the powers that be to drop spaces entirely...
add a comment |
I had a similar problem with group name "domain users" coming from AD. For chown
I was able to use group id number instead of group name. For example:
sudo chown -R user1:118600513 /home/user1
where 118600513 is the id for a group "domain users".
Using the GID might work forchown
(since the group name doesn't really exist at that level), but I don't think this answers the question of how manage user-to-group membership with names like that.
– ilkkachu
Feb 6 '18 at 10:45
@ilkkachu, thanks! I have updated my answer. But you are right - probably it does not help OP.
– djhurio
Feb 6 '18 at 12:50
add a comment |
I did not try this for group but for user info that is gecos info as in usermod command add " " i.e inverted commas with space in between.
usermod username -c User" "Name
add a comment |
I spent an entire day searching the same topic.
Here's what I found and tested on Debian 9 + Samba AD DC 4.5.12
In order to set sharing folder permission, a somewhat local unix group or user must be present.
Option 1: Create Group with gid
I failed to map the gid after creation by net groupmap, but was able to map them at the time of creation by
groupadd localgroupnamewithoutspace
cat /etc/group
samba-tool group add "Groupname with Space" --nis-domain=mydomain --gid-number=corresponding gid we just saw in /etc/group
chgrp localgroupnamewithoutspace /path/of/share
chmod 0770 /path/of/share
Option 2: Look up gid of AD group
Unix group doesn't allow space, so set group of directory to gid will work.
However, when doing ls -al it will show gid number not AD group or Unix group name. This could potentially be a problem if multiple groups are nested and assigned in the same large sharing parent directory.
wbinfo --name-to-sid "AD Group name with space"
wbinfo --sid-to-gid "copy from the ouput above"
it should look like this and you only need this part S-1-5-21-53980404-2501955692-3283166571-512
then use the gid number when setting permission by chgrp, chmod.
Noted, The above only takes care of AD group and Unix group mapping, the actual ACL and group member permission still requires to have proper SeDiskOperatorPrivilege setup, and then configured through Windows Client with account has SeDiskOperatorPrivilege in File Explorer and ADUC.
edited: typo
add a comment |
i Have doubt :
Is it possible to create the user name has only space( )..?
New contributor
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%2f401752%2fhow-to-add-to-group-when-name-has-a-space%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
Group and user names aren’t allowed to contain the space character on POSIX-style systems; see Command line login failed with two strings ID in Debian Stretch for references (the restrictions apply to groups as well as users).
In your case you might be able to work around the limitation by managing your groups in AD rather than in /etc/group
. But I’d recommend trying to convince the powers that be to drop spaces entirely...
add a comment |
Group and user names aren’t allowed to contain the space character on POSIX-style systems; see Command line login failed with two strings ID in Debian Stretch for references (the restrictions apply to groups as well as users).
In your case you might be able to work around the limitation by managing your groups in AD rather than in /etc/group
. But I’d recommend trying to convince the powers that be to drop spaces entirely...
add a comment |
Group and user names aren’t allowed to contain the space character on POSIX-style systems; see Command line login failed with two strings ID in Debian Stretch for references (the restrictions apply to groups as well as users).
In your case you might be able to work around the limitation by managing your groups in AD rather than in /etc/group
. But I’d recommend trying to convince the powers that be to drop spaces entirely...
Group and user names aren’t allowed to contain the space character on POSIX-style systems; see Command line login failed with two strings ID in Debian Stretch for references (the restrictions apply to groups as well as users).
In your case you might be able to work around the limitation by managing your groups in AD rather than in /etc/group
. But I’d recommend trying to convince the powers that be to drop spaces entirely...
answered Nov 1 '17 at 8:40
Stephen KittStephen Kitt
172k24387465
172k24387465
add a comment |
add a comment |
I had a similar problem with group name "domain users" coming from AD. For chown
I was able to use group id number instead of group name. For example:
sudo chown -R user1:118600513 /home/user1
where 118600513 is the id for a group "domain users".
Using the GID might work forchown
(since the group name doesn't really exist at that level), but I don't think this answers the question of how manage user-to-group membership with names like that.
– ilkkachu
Feb 6 '18 at 10:45
@ilkkachu, thanks! I have updated my answer. But you are right - probably it does not help OP.
– djhurio
Feb 6 '18 at 12:50
add a comment |
I had a similar problem with group name "domain users" coming from AD. For chown
I was able to use group id number instead of group name. For example:
sudo chown -R user1:118600513 /home/user1
where 118600513 is the id for a group "domain users".
Using the GID might work forchown
(since the group name doesn't really exist at that level), but I don't think this answers the question of how manage user-to-group membership with names like that.
– ilkkachu
Feb 6 '18 at 10:45
@ilkkachu, thanks! I have updated my answer. But you are right - probably it does not help OP.
– djhurio
Feb 6 '18 at 12:50
add a comment |
I had a similar problem with group name "domain users" coming from AD. For chown
I was able to use group id number instead of group name. For example:
sudo chown -R user1:118600513 /home/user1
where 118600513 is the id for a group "domain users".
I had a similar problem with group name "domain users" coming from AD. For chown
I was able to use group id number instead of group name. For example:
sudo chown -R user1:118600513 /home/user1
where 118600513 is the id for a group "domain users".
edited Feb 6 '18 at 12:49
answered Feb 6 '18 at 10:40
djhuriodjhurio
1093
1093
Using the GID might work forchown
(since the group name doesn't really exist at that level), but I don't think this answers the question of how manage user-to-group membership with names like that.
– ilkkachu
Feb 6 '18 at 10:45
@ilkkachu, thanks! I have updated my answer. But you are right - probably it does not help OP.
– djhurio
Feb 6 '18 at 12:50
add a comment |
Using the GID might work forchown
(since the group name doesn't really exist at that level), but I don't think this answers the question of how manage user-to-group membership with names like that.
– ilkkachu
Feb 6 '18 at 10:45
@ilkkachu, thanks! I have updated my answer. But you are right - probably it does not help OP.
– djhurio
Feb 6 '18 at 12:50
Using the GID might work for
chown
(since the group name doesn't really exist at that level), but I don't think this answers the question of how manage user-to-group membership with names like that.– ilkkachu
Feb 6 '18 at 10:45
Using the GID might work for
chown
(since the group name doesn't really exist at that level), but I don't think this answers the question of how manage user-to-group membership with names like that.– ilkkachu
Feb 6 '18 at 10:45
@ilkkachu, thanks! I have updated my answer. But you are right - probably it does not help OP.
– djhurio
Feb 6 '18 at 12:50
@ilkkachu, thanks! I have updated my answer. But you are right - probably it does not help OP.
– djhurio
Feb 6 '18 at 12:50
add a comment |
I did not try this for group but for user info that is gecos info as in usermod command add " " i.e inverted commas with space in between.
usermod username -c User" "Name
add a comment |
I did not try this for group but for user info that is gecos info as in usermod command add " " i.e inverted commas with space in between.
usermod username -c User" "Name
add a comment |
I did not try this for group but for user info that is gecos info as in usermod command add " " i.e inverted commas with space in between.
usermod username -c User" "Name
I did not try this for group but for user info that is gecos info as in usermod command add " " i.e inverted commas with space in between.
usermod username -c User" "Name
answered Aug 17 '18 at 6:09
YogiYogi
1
1
add a comment |
add a comment |
I spent an entire day searching the same topic.
Here's what I found and tested on Debian 9 + Samba AD DC 4.5.12
In order to set sharing folder permission, a somewhat local unix group or user must be present.
Option 1: Create Group with gid
I failed to map the gid after creation by net groupmap, but was able to map them at the time of creation by
groupadd localgroupnamewithoutspace
cat /etc/group
samba-tool group add "Groupname with Space" --nis-domain=mydomain --gid-number=corresponding gid we just saw in /etc/group
chgrp localgroupnamewithoutspace /path/of/share
chmod 0770 /path/of/share
Option 2: Look up gid of AD group
Unix group doesn't allow space, so set group of directory to gid will work.
However, when doing ls -al it will show gid number not AD group or Unix group name. This could potentially be a problem if multiple groups are nested and assigned in the same large sharing parent directory.
wbinfo --name-to-sid "AD Group name with space"
wbinfo --sid-to-gid "copy from the ouput above"
it should look like this and you only need this part S-1-5-21-53980404-2501955692-3283166571-512
then use the gid number when setting permission by chgrp, chmod.
Noted, The above only takes care of AD group and Unix group mapping, the actual ACL and group member permission still requires to have proper SeDiskOperatorPrivilege setup, and then configured through Windows Client with account has SeDiskOperatorPrivilege in File Explorer and ADUC.
edited: typo
add a comment |
I spent an entire day searching the same topic.
Here's what I found and tested on Debian 9 + Samba AD DC 4.5.12
In order to set sharing folder permission, a somewhat local unix group or user must be present.
Option 1: Create Group with gid
I failed to map the gid after creation by net groupmap, but was able to map them at the time of creation by
groupadd localgroupnamewithoutspace
cat /etc/group
samba-tool group add "Groupname with Space" --nis-domain=mydomain --gid-number=corresponding gid we just saw in /etc/group
chgrp localgroupnamewithoutspace /path/of/share
chmod 0770 /path/of/share
Option 2: Look up gid of AD group
Unix group doesn't allow space, so set group of directory to gid will work.
However, when doing ls -al it will show gid number not AD group or Unix group name. This could potentially be a problem if multiple groups are nested and assigned in the same large sharing parent directory.
wbinfo --name-to-sid "AD Group name with space"
wbinfo --sid-to-gid "copy from the ouput above"
it should look like this and you only need this part S-1-5-21-53980404-2501955692-3283166571-512
then use the gid number when setting permission by chgrp, chmod.
Noted, The above only takes care of AD group and Unix group mapping, the actual ACL and group member permission still requires to have proper SeDiskOperatorPrivilege setup, and then configured through Windows Client with account has SeDiskOperatorPrivilege in File Explorer and ADUC.
edited: typo
add a comment |
I spent an entire day searching the same topic.
Here's what I found and tested on Debian 9 + Samba AD DC 4.5.12
In order to set sharing folder permission, a somewhat local unix group or user must be present.
Option 1: Create Group with gid
I failed to map the gid after creation by net groupmap, but was able to map them at the time of creation by
groupadd localgroupnamewithoutspace
cat /etc/group
samba-tool group add "Groupname with Space" --nis-domain=mydomain --gid-number=corresponding gid we just saw in /etc/group
chgrp localgroupnamewithoutspace /path/of/share
chmod 0770 /path/of/share
Option 2: Look up gid of AD group
Unix group doesn't allow space, so set group of directory to gid will work.
However, when doing ls -al it will show gid number not AD group or Unix group name. This could potentially be a problem if multiple groups are nested and assigned in the same large sharing parent directory.
wbinfo --name-to-sid "AD Group name with space"
wbinfo --sid-to-gid "copy from the ouput above"
it should look like this and you only need this part S-1-5-21-53980404-2501955692-3283166571-512
then use the gid number when setting permission by chgrp, chmod.
Noted, The above only takes care of AD group and Unix group mapping, the actual ACL and group member permission still requires to have proper SeDiskOperatorPrivilege setup, and then configured through Windows Client with account has SeDiskOperatorPrivilege in File Explorer and ADUC.
edited: typo
I spent an entire day searching the same topic.
Here's what I found and tested on Debian 9 + Samba AD DC 4.5.12
In order to set sharing folder permission, a somewhat local unix group or user must be present.
Option 1: Create Group with gid
I failed to map the gid after creation by net groupmap, but was able to map them at the time of creation by
groupadd localgroupnamewithoutspace
cat /etc/group
samba-tool group add "Groupname with Space" --nis-domain=mydomain --gid-number=corresponding gid we just saw in /etc/group
chgrp localgroupnamewithoutspace /path/of/share
chmod 0770 /path/of/share
Option 2: Look up gid of AD group
Unix group doesn't allow space, so set group of directory to gid will work.
However, when doing ls -al it will show gid number not AD group or Unix group name. This could potentially be a problem if multiple groups are nested and assigned in the same large sharing parent directory.
wbinfo --name-to-sid "AD Group name with space"
wbinfo --sid-to-gid "copy from the ouput above"
it should look like this and you only need this part S-1-5-21-53980404-2501955692-3283166571-512
then use the gid number when setting permission by chgrp, chmod.
Noted, The above only takes care of AD group and Unix group mapping, the actual ACL and group member permission still requires to have proper SeDiskOperatorPrivilege setup, and then configured through Windows Client with account has SeDiskOperatorPrivilege in File Explorer and ADUC.
edited: typo
edited Sep 7 '18 at 23:32
Rui F Ribeiro
40.3k1479137
40.3k1479137
answered Mar 19 '18 at 9:40
CayprolCayprol
12
12
add a comment |
add a comment |
i Have doubt :
Is it possible to create the user name has only space( )..?
New contributor
add a comment |
i Have doubt :
Is it possible to create the user name has only space( )..?
New contributor
add a comment |
i Have doubt :
Is it possible to create the user name has only space( )..?
New contributor
i Have doubt :
Is it possible to create the user name has only space( )..?
New contributor
New contributor
answered 38 mins ago
user337846user337846
1
1
New contributor
New contributor
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%2f401752%2fhow-to-add-to-group-when-name-has-a-space%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
Did you try "%20"?
– Ignacio Vazquez-Abrams
Nov 1 '17 at 4:19
1
You want to add a group (that has a space in it) into another group? How does that work on unix?
– thrig
Nov 1 '17 at 4:22
Won't "%20" be treated literally instead in this case?
– markyxyz
Nov 1 '17 at 4:24
@thrig I know, right? I can't even add a username like "foo bars" coz of restrictions. And even if I could, I would not do that. It's just bad practice. Alas, this is not just up to me. How do I explain this to clients? I want to exhaust all other options where possible before going back to them and probably get into an argument.
– markyxyz
Nov 1 '17 at 4:27
4
Why, for the sake of Church of Emacs, would somebody like to have a username (or group name) with space in it?
– cezar
Nov 1 '17 at 7:27