Changing server password!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Joe
Forum Regular
Posts: 939
Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow

Changing server password!

Post by Joe »

Is it possible to change your servers password with PHP?. I thought about using passwd but it does not accept parameters :(

Joe
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

If it is possible you might be able to do it using something like (although I can't remember much unix)

Code: Select all

system('cha youruserid pass(newpassword)');
Or some other command line with the system() function
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

yet another reason why i like to have all the user info (and credentials) in a ldap tree :)

so the answer is: it is possible to change the password, but you have to make sure you have the required privileges to do so. and those required privileges depend on where/how you save the credentials...
User avatar
Joe
Forum Regular
Posts: 939
Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow

Post by Joe »

Is cha a valid unix command?. As previously stated, I tried using the passwd command with specified parameters but it failed to work. Any suggestions?.
Post Reply