LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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
 
LinkBack Search this Thread
Old 05-27-2006, 01:49 AM   #1
prabhatsoni
Member
 
Registered: Oct 2004
Location: India
Distribution: FC 12
Posts: 233

Rep: Reputation: 30
Can my shell script change the password of user ?


Hello Gurus,

I am struck up.

I have a portal where I am saving user passwords and names, privileges in an mysql table. The interface is web based, with apache+php+mysql.

Some of the service like access to various databases are available to users through web interface. Password-change facility has been given to the users wherein the password in the mysql table is changes through a mysql query (through php). Fairly easy to impelement.

But there are some services which use system accounts. Thus each user has two accounts. One in the mysql database and the other in the system. Highly undesirable and irregular.

I was thinking of running a shell script (from php) which will set the system password to the new password given by the user. Thus whenever the user changes his password, it will be changed in both the places - giving him a feeling that there is only one account.

The shell script which would change the user password in the system account seems to be a tough nut to crack. I have searched this very forum without success.


Can any of the gurus help me.


-Thanks in advance.


Prabhat Soni
 
Old 05-27-2006, 02:06 AM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 326Reputation: 326Reputation: 326Reputation: 326
The chpasswd command will do what you want.

man chpasswd

DESCRIPTION
chpasswd reads a list of user name and password pairs from standard input and uses this information to update a group of existing users.
 
  


Reply

Tags
password


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell script to change password kamal_aitin Linux - General 6 07-25-2007 12:09 AM
Help! Cannot Add a User to User Manager or Change Root Password lennysokol Linux - General 2 06-25-2005 09:59 AM
what is the command to make a user change their password after creating a new user? naweenio Linux - Newbie 7 01-05-2005 07:07 AM
how to assign password for a user in shell script mtest Programming 10 10-29-2003 06:52 AM
Restricted shell to change the password mussons Linux - Security 12 07-24-2003 10:05 PM


All times are GMT -5. The time now is 01:13 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration