LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-26-2009, 01:29 PM   #1
Karas
Member
 
Registered: Oct 2009
Distribution: Slackware 13.0
Posts: 49

Rep: Reputation: 15
What encryption does the /etc/shadow file use for passwords?


I am just wondering what encryption method the shadow file uses, so that I may be able to manually change it. I ask this because I am trying to make a web page that will allow people to change their linux password via a browser.

Or if anyone has any better ideas I am open to suggestions.

Thanks again.
 
Old 11-26-2009, 01:34 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,420

Rep: Reputation: 8111Reputation: 8111Reputation: 8111Reputation: 8111Reputation: 8111Reputation: 8111Reputation: 8111Reputation: 8111Reputation: 8111Reputation: 8111Reputation: 8111
Quote:
Originally Posted by Karas View Post
I am just wondering what encryption method the shadow file uses, so that I may be able to manually change it. I ask this because I am trying to make a web page that will allow people to change their linux password via a browser.

Or if anyone has any better ideas I am open to suggestions.

Thanks again.
There are several that can be used, and what your options are, depends on your system and how you set it up. openSUSE uses Blowfish by default, others use MDx, etc.

And I would *NEVER* allow password changes via web page....so many security holes, it's not even funny. That said, it's your call...I'd use the default "passwd" program, and just pass it a string from the web form, and not code your own.
 
Old 11-26-2009, 01:44 PM   #3
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Rep: Reputation: 217Reputation: 217Reputation: 217
If you want to supply more information on what your intending to achieve might be able to give a better answer to this question. Are the customer's not able to use SSH for any particular reason?

I would advise that if you have a page that does anything around passwords that you ensure it's using an SSL certificate (ie an https:// page instead of a normal http://).
 
Old 11-26-2009, 02:34 PM   #4
Karas
Member
 
Registered: Oct 2009
Distribution: Slackware 13.0
Posts: 49

Original Poster
Rep: Reputation: 15
Customers can use SSH if they choose, but this is for a uni project, and I am meant to add extra value, one such value being web stuff, file upload, password changing and blog software etc.

How would I pass a string to passwd from a web page?

Would it be purely just: -

Quote:
<?php
exec ('echo "$userpass:$userpass" | passwd', $data, $ret)
?>
 
Old 11-26-2009, 07:01 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,419

Rep: Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785
There is a non-interactive mode for the passwd cmd

echo password | passwd --stdin $USER
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Shadow passwords - Changing encryption method from MD5 to SHA Phaethar Linux - Security 1 11-04-2009 05:38 PM
looking for a portable encryption method for passwords file nephish Linux - Software 5 10-05-2009 10:46 AM
EDK corrupted all my passwords? Can't find /etc/shadow file to edit! fy1000000 Linux - Newbie 27 05-22-2009 11:46 AM
shadow passwords help? SciYro Linux - Security 2 03-03-2004 06:11 AM
Am I using shadow passwords? keirobyn Linux - Newbie 1 01-28-2002 01:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:49 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