|
Posted by Daemon on 01/01/06 22:38
4site wrote:
> Happy New Year and all that!
>
> I'd like to write a short PHP script that will allow users to alter
> their virtual server password via a secure web form. I had hoped that
> I might be able to call the shell passwd command from PHP, something
> like this:
>
> exec( "passwd -O $oldpassword -P $newpassword $username" );
>
> but of course that doesn't seem to work.
>
> Is it possible to execute the passwd command silently, ie without the
> shell prompting (twice) for New Password? Or should I be looking in
> another direction altogether - perhaps by editing the
> /usr/local/etc/passwd file instead, yes?
>
> Some advice would be greatly appreciated, thanks.
>
You will need to ensure that you are root, or someone with enough
permission, and second, neither is suggested!
I attempted to do the same in a BASH script, and was strongly suggested
to quitthe attempt! Oh, it may be a better idea to use system('');
Navigation:
[Reply to this message]
|