Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
password and useradd
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
lecholet
n00b
n00b


Joined: 15 Jul 2002
Posts: 39
Location: Montreal, Canada

PostPosted: Wed Jul 17, 2002 7:22 pm    Post subject: password and useradd Reply with quote

This is probably a lame question. I cant figure out why i have to supply useradd with an encrypted password. I was using slackware before and i swear i could supply an UNencrypted password to this command (useradd encrypted it for me).

Now my question is how can i crypt a password so i can finaly add users in my system.

regards,
lecholet
Back to top
View user's profile Send private message
rizzo
Retired Dev
Retired Dev


Joined: 30 Apr 2002
Posts: 1067
Location: Manitowoc, WI, USA

PostPosted: Wed Jul 17, 2002 7:23 pm    Post subject: Reply with quote

Not sure what you are talking about. I don't have to encrypt passwords when I call useradd.

What flags are you passing into useradd when you call it?
Back to top
View user's profile Send private message
lecholet
n00b
n00b


Joined: 15 Jul 2002
Posts: 39
Location: Montreal, Canada

PostPosted: Wed Jul 17, 2002 7:27 pm    Post subject: Reply with quote

This is weird. in the man page of useadd, it says:

-p passwd:

The encrypted password, as returned by crypt(3). The default is to disable the account.

I tried with an unencrypted password anyway, and it didnt work (i tried -p abcdefg and i look at /etc/shadow and abcdefg was written in the passwd field.)
Back to top
View user's profile Send private message
rizzo
Retired Dev
Retired Dev


Joined: 30 Apr 2002
Posts: 1067
Location: Manitowoc, WI, USA

PostPosted: Wed Jul 17, 2002 7:32 pm    Post subject: Reply with quote

I never pass the password in on the command-line, just because then it's visible on the screen (cubicle walls do not a prison make). I create the account specifying home dir and shell and group and whatever else. Then call passwd on that account to set the password.

I realize you're probably used to doing it all on the command line but this is just what I do and my recommendation. And I know it works. :P
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Wed Jul 17, 2002 7:33 pm    Post subject: Reply with quote

How about just creating the user and using passwd to change the password afterwards?
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
lecholet
n00b
n00b


Joined: 15 Jul 2002
Posts: 39
Location: Montreal, Canada

PostPosted: Wed Jul 17, 2002 7:46 pm    Post subject: Reply with quote

ok, it works the way you told me. But i still cant figure out why we cant do it in one command line... oh well

regards
lecholet
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Wed Jul 17, 2002 7:58 pm    Post subject: Reply with quote

lecholet wrote:
i still cant figure out why we cant do it in one command line

Probably to prevent passwords being displayed in cleartext on the terminal. BTW, as a result of an interchange in this thread, if you're still fixated on this, try:
Code:
# emerge cli-crypt
# useradd -p `crypt password` username

_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum