You are not logged in.

#1 2011-03-06 18:41:27

Lowra
Member
Registered: 2009-09-21
Posts: 192

[SOLVED] Setting a password with useradd, and questions about groups

Hello,

Until now, I used to add users to my system using the adduser script. But I recently found out the useradd command which seem more convenient to me.
But I have a problem with it, even after reading the manpages.

The command I run as root is:

useradd -g users -G storage,optical,network,audio,video -m mylogin

Then I logout, and try to log in as mylogin, but the prompt ask me for a password (I haven't set it...). If I leave blank and type enter, it says that my password is incorrect.

I also tried:

useradd -g users -G storage,optical,network,audio,video -p mypassword -m mylogin

Then I logout, and try to log in as mylogin, the prompt ask me for a password, I type mypassword and type enter, but it says once again that my password is incorrect yikes

The last question I would like to ask is: What are the groups that I really need for my desktop ? (I could add a lot of them, but I'm interested in understanding what I do)

Do I need storage for accessing my partitions ? Do I need optical to read/burn DVD ? Do I need network to use networkmanager ? Do I need audio to listen to music ? video to watch 1080p movies with VLC on my Intel i3 chipset ?

Thanks a lot :]

Last edited by Lowra (2011-03-07 13:49:51)

Offline

#2 2011-03-06 19:03:32

JokerBoy
Member
From: România
Registered: 2009-09-24
Posts: 641

Re: [SOLVED] Setting a password with useradd, and questions about groups

passwd: set/change user password.

usage:

passwd username

https://wiki.archlinux.org/index.php/Us … ups#Groups

Offline

#3 2011-03-06 19:27:41

Lowra
Member
Registered: 2009-09-21
Posts: 192

Re: [SOLVED] Setting a password with useradd, and questions about groups

I know about passwd, but it'll be much more easier if I could define the password while creating the account, and not have to change it afterward

Offline

#4 2011-03-06 19:29:33

loafer
Member
From: the pub
Registered: 2009-04-14
Posts: 1,772

Re: [SOLVED] Setting a password with useradd, and questions about groups

How did you generate the password?  According to the manpage it needs to be encrypted when you use the -p flag.  If you enter a text string (e.g. mypassword), it will be added to shadow as text, which won't work.


All men have stood for freedom...
For freedom is the man that will turn the world upside down.
Gerrard Winstanley.

Offline

#5 2011-03-06 20:12:48

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: [SOLVED] Setting a password with useradd, and questions about groups

the preferred way is to use listed statements in the shell
useradd foo && passwd foo

to answer your questions on groups, it depends entirely on how you've set up your system
a good starting point is the wiki article linked to in JokerBoy's post


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#6 2011-03-07 13:49:30

Lowra
Member
Registered: 2009-09-21
Posts: 192

Re: [SOLVED] Setting a password with useradd, and questions about groups

@loafer: You were right. I entered mypassword directly without any encryption, I guess it was the cause of the problem :]

@fsckd: Thank you, it worked perfectly !

Offline

Board footer

Powered by FluxBB