Re: Add new user with a specif password in script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Nov 09, 2003 at 04:41:30PM -0200, romildo@xxxxxxxxxxx wrote:

> I see that the command "useradd" does have the "-p passwd" option,
> but the "passwd" should be encrypted, as returned by crypt(3).  Then
> how can I obtain the encrypted password?

$ perl -e 'print crypt("password", "salt") . "\n"'
sa3tHJ3/KuYvI

> Any clues?

# useradd joe; echo password | passwd --stdin joe

This has the advantage that joe will get an md5 password hash rather
than a less secure crypted one.

-- 
John Kodis                                    Goddard Space Flight Center
kodis@xxxxxxxxxxxxxxxxxxxxx                      Greenbelt, Maryland, USA
Phone: 301-286-7376                                     Fax: 301-286-1771




[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux