hi
I want to change the password of the linux/unix user. For e.g In my linux system the user name is "vinod" and the password is "vinod12". Please can anyone give me the solution to change the password of the linux user from PHP code. I want to change it through programatically using PHP . If anyone can help me or give me the solution i will be very thankful to u friends. Can anyone give me some steps inthe form of phpfile please?
with regards
vinod
How to change Linux user password from PHP code?
Moderator: General Moderators
-
vinod_bujji
- Forum Newbie
- Posts: 3
- Joined: Tue Jun 03, 2003 4:52 am
- Location: hyderabad
its almost totally unlikely you'd be able to do that with php, because its permission set is unable to read the password file in a unix environment. php would need to be run under a group account that had this access, which means no shared host worth its servers would have this set up. if you installed php yourself on your own linux box, you could assign its group permission to access whatever file your linux passwords are stored in.
then its possible
then its possible
Changing your own account password (the same account as the owner of the php-files being processed) is possible, if the Apache server is suexec enabled, make a 0700 permitted script and it will run as your own user and you can now run the passwd command... Most (sane) systems and cgi-wrappers wont allow doing this as root..
A different approach would be to have the script add an entry to a file or a database an dthen make a cron-job that checks this database and performs the queued commands, a great deal of caution and security aware thinking should be a part of it..
A different approach would be to have the script add an entry to a file or a database an dthen make a cron-job that checks this database and performs the queued commands, a great deal of caution and security aware thinking should be a part of it..