Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
07-26-2005, 07:03 AM
|
#1
|
Member
Registered: Oct 2004
Posts: 43
Rep:
|
adduser no encrypt
Hi,
I'm runnig this code:
adduser -d /home/user -p apassword ausername
However "apassword" is never encrypted?????
When view /etc/shadow it's in there as 'apassword', not encrypted.
I'm also using pureftpd, and when i do the command to create the pureftpd user database, the password is still no encrypted, meaing i can't login.
I also get invalid password when trying to su to that user when i enter the password.
The root password is encrypted, and so is the user i created when i setup the system.
|
|
|
07-26-2005, 07:23 AM
|
#2
|
Member
Registered: Oct 2004
Location: Poland
Distribution: Slack 10.1, Mandrake 10.1
Posts: 118
Rep:
|
hmmmmmmmmm.... Try to change password after creating user :
# adduser -d /home/user -p "anything" ausername
# passwd ausername
Enter password :
And here type apassword
|
|
|
07-26-2005, 07:31 AM
|
#3
|
Member
Registered: Oct 2004
Posts: 43
Original Poster
Rep:
|
Anyway i can do this in a perl script?
I need to be able to do it all automatically.
|
|
|
07-26-2005, 08:01 AM
|
#4
|
Member
Registered: Oct 2004
Posts: 43
Original Poster
Rep:
|
OK, i've discovered that it doesn't do it on my other machine either, so i guess adduser doesn't make encrypted passwords.
How do I use perl to get an encrypted password that will work with linux, so i can access via FTP and SU.
|
|
|
07-26-2005, 09:50 AM
|
#5
|
Senior Member
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Rep:
|
Looking at the man page for adduser you will see the following statement:
-p passwd
The encrypted password, as returned by crypt(3). The default is to disable the account.
So, I take it adduser is expecting the password hash and not the actual password.
|
|
|
07-26-2005, 10:02 AM
|
#6
|
Member
Registered: Oct 2004
Posts: 43
Original Poster
Rep:
|
Yeah, found that now :-)
Still leaves the question, how can i do this in perl?
Thanks,
Andrew
|
|
|
07-26-2005, 10:06 AM
|
#7
|
Senior Member
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Rep:
|
The Digest::MD5 module has functions that can compute the digest for you so you can pass it into adduser... I had intended on mentioning that in the last post... opps.
|
|
|
All times are GMT -5. The time now is 04:58 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|