You are not logged in.
Pages: 1
Anybody here know Forum Syntax?
I was reading through useradd in the wiki and came across this line:
useradd -m -g users -G audio,video,etc, etc -s /bin/bash username and it never added my username to users.
I tried it like this:
useradd -m -G audio,video,etc.etc -s /bin/bash username; // That worked fine, now why didn't it work in the first line I showed?? Either way, the second line worked..
Thought I'd leave a post about it.
I was also thinking useradd -m -g users -G audio,video,etc.etc -s /bin/bash username keeps users out of the /etc/group file, but I'm thinking I am wrong on that part.
IF anybody does, and notices the same issue, then maybe somebody who knows Forums Syntax can update wiki and remove the -g users part.
Offline
In my system the code that you provided works normal, and I get the username in group users, just login in account and type "groups".
about the file /etc/group, it does not show the user name inside, the username is shown in /etc/passwd.
if you wanna create a group with same name of username you should you use the option "-U" (is more like ubuntu that create a group with your username), because the option "-m" only set your default group.
Sorry if I misunderstood.
~/ren2r ...sorry for my bad english
Offline
Please don't start threads in Forum & Wiki discussion. This forum is meant for discussing changes in wiki articles and forums itself.
If you have questions regarding something, look for an appropriate sub-forum.
Moving to Newbie Corner...
There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !
Offline
In my system the code that you provided works normal, and I get the username in group users, just login in account and type "groups".
about the file /etc/group, it does not show the user name inside, the username is shown in /etc/passwd.
if you wanna create a group with same name of username you should you use the option "-U" (is more like ubuntu that create a group with your username), because the option "-m" only set your default group.Sorry if I misunderstood.
No no, I thought maybe there was possibly something I wasn't understanding about that.. Anyway, the second line I showed worked fine... I was just trying to be lazy and just do it all at once, rather than typing gpasswd -a username group, LOL..
Offline
*sigh*
useradd -m -g users -G audio,video,etc, etc -s /bin/bash username
Guys, guys - use your brainwaves a little bit ...
How often have you seen the phrase:
whatever whatever etc, etc - the 'etc' part is a manner of speech - it means 'etcetera' (and that can be looked up in an encyclopedia!)
Also - if you do a 'man useradd' or just run the command 'useradd' without any arguments you will see that the quoted line is syntactically incorrect - it is trying to add a user called 'etc'
When it was changed to 'etc.etc' it became syntactically correct, which is why it was accepted - however - there is no group called 'etc' or 'etc.etc'.
Granted, you can create a group called 'etc' or 'etc.etc', however, I doubt very much that that was the intention of the command.
'man' is your friend!!
Oh and by-the-way - the '-m' option creates the home directory for the user if it doesn't exist (man useradd!!)
- and, the username _is_ found in the /etc/group file for all other groups but the primary one.
Just try a 'grep root /etc/group'
Last edited by perbh (2011-07-11 14:31:48)
Offline
I don't think the OP meant he actually typed "etc"...I think he was using it to illustrate that he typed all the groups he wanted the user to be in (he was actually using the manner of speech you were referring to) and that
useradd -m -g users -G (other groups) /bin/bash username
didnt work for him, but
useradd -m -G (groups) /bin/bash username
did work. At least that's my understanding of the situation.
Last edited by jgreen1tc (2011-07-11 17:55:51)
Offline
*sigh*
useradd -m -g users -G audio,video,etc, etc -s /bin/bash username
Guys, guys - use your brainwaves a little bit ...
How often have you seen the phrase:
whatever whatever etc, etc - the 'etc' part is a manner of speech - it means 'etcetera' (and that can be looked up in an encyclopedia!)
Also - if you do a 'man useradd' or just run the command 'useradd' without any arguments you will see that the quoted line is syntactically incorrect - it is trying to add a user called 'etc'When it was changed to 'etc.etc' it became syntactically correct, which is why it was accepted - however - there is no group called 'etc' or 'etc.etc'.
Granted, you can create a group called 'etc' or 'etc.etc', however, I doubt very much that that was the intention of the command.'man' is your friend!!
Oh and by-the-way - the '-m' option creates the home directory for the user if it doesn't exist (man useradd!!)
- and, the username _is_ found in the /etc/group file for all other groups but the primary one.
Just try a 'grep root /etc/group'
Umm, the etc, was just an illustration like the last post said. And yah, I knew what -m does..
Offline
I don't think the OP meant he actually typed "etc"...I think he was using it to illustrate that he typed all the groups he wanted the user to be in (he was actually using the manner of speech you were referring to) and that
useradd -m -g users -G (other groups) /bin/bash username
didnt work for him, but
useradd -m -G (groups) /bin/bash username
did work. At least that's my understanding of the situation.
What OP? LOL.. You understood what I meant perfectly jgreen1tc
Offline
The OP should also know by now, that "didn't work" is no valid placeholder for shell output of the error :-D
Offline
The OP should also know by now, that "didn't work" is no valid placeholder for shell output of the error :-D
Whoops, sorry, typo, what does OP mean?
Offline
Offline
LOL, Definition one is resorting to gaming.. OP I found out was Original Poster.
Offline
I would suggest taking a look at adduser too. It is more friendly for interactive use.
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
Pages: 1