LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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


Reply
  Search this Thread
Old 07-26-2005, 07:03 AM   #1
andy7t
Member
 
Registered: Oct 2004
Posts: 43

Rep: Reputation: 15
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.
 
Old 07-26-2005, 07:23 AM   #2
mmmm
Member
 
Registered: Oct 2004
Location: Poland
Distribution: Slack 10.1, Mandrake 10.1
Posts: 118

Rep: Reputation: 15
hmmmmmmmmm.... Try to change password after creating user :

# adduser -d /home/user -p "anything" ausername
# passwd ausername
Enter password :

And here type apassword
 
Old 07-26-2005, 07:31 AM   #3
andy7t
Member
 
Registered: Oct 2004
Posts: 43

Original Poster
Rep: Reputation: 15
Anyway i can do this in a perl script?
I need to be able to do it all automatically.
 
Old 07-26-2005, 08:01 AM   #4
andy7t
Member
 
Registered: Oct 2004
Posts: 43

Original Poster
Rep: Reputation: 15
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.
 
Old 07-26-2005, 09:50 AM   #5
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
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.
 
Old 07-26-2005, 10:02 AM   #6
andy7t
Member
 
Registered: Oct 2004
Posts: 43

Original Poster
Rep: Reputation: 15
Yeah, found that now :-)

Still leaves the question, how can i do this in perl?

Thanks,
Andrew
 
Old 07-26-2005, 10:06 AM   #7
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
encrypt and decrypt using encrypt(char block[64], int edflag) rockwell_001 Linux - Security 3 08-30-2009 09:16 AM
How to encrypt URLs? servnov Linux - Security 9 08-15-2005 10:19 PM
encrypt error hudo *BSD 0 01-02-2005 11:13 AM
crypt vs encrypt liguorir Linux - Software 3 05-20-2004 10:38 PM
Encrypt vivekind Linux - General 1 01-16-2002 03:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration