View previous topic :: View next topic |
Author |
Message |
lecholet n00b


Joined: 15 Jul 2002 Posts: 39 Location: Montreal, Canada
|
Posted: Wed Jul 17, 2002 7:22 pm Post subject: password and useradd |
|
|
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 |
|
 |
rizzo Retired Dev


Joined: 30 Apr 2002 Posts: 1067 Location: Manitowoc, WI, USA
|
Posted: Wed Jul 17, 2002 7:23 pm Post subject: |
|
|
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 |
|
 |
lecholet n00b


Joined: 15 Jul 2002 Posts: 39 Location: Montreal, Canada
|
Posted: Wed Jul 17, 2002 7:27 pm Post subject: |
|
|
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 |
|
 |
rizzo Retired Dev


Joined: 30 Apr 2002 Posts: 1067 Location: Manitowoc, WI, USA
|
Posted: Wed Jul 17, 2002 7:32 pm Post subject: |
|
|
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.  |
|
Back to top |
|
 |
rac Bodhisattva


Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Wed Jul 17, 2002 7:33 pm Post subject: |
|
|
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 |
|
 |
lecholet n00b


Joined: 15 Jul 2002 Posts: 39 Location: Montreal, Canada
|
Posted: Wed Jul 17, 2002 7:46 pm Post subject: |
|
|
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 |
|
 |
rac Bodhisattva


Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Wed Jul 17, 2002 7:58 pm Post subject: |
|
|
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 |
|
 |
|