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 |
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.
|
|
11-26-2009, 01:29 PM
|
#1
|
Member
Registered: Oct 2009
Distribution: Slackware 13.0
Posts: 49
Rep:
|
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.
|
|
|
11-26-2009, 01:34 PM
|
#2
|
LQ Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,420
|
Quote:
Originally Posted by Karas
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.
|
|
|
11-26-2009, 01:44 PM
|
#3
|
Senior Member
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375
|
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://).
|
|
|
11-26-2009, 02:34 PM
|
#4
|
Member
Registered: Oct 2009
Distribution: Slackware 13.0
Posts: 49
Original Poster
Rep:
|
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)
?>
|
|
|
|
11-26-2009, 07:01 PM
|
#5
|
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,419
|
There is a non-interactive mode for the passwd cmd
echo password | passwd --stdin $USER
|
|
|
All times are GMT -5. The time now is 05:49 AM.
|
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
|
|