problem to execute shell command in php

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
rockobop
Forum Newbie
Posts: 8
Joined: Thu Aug 28, 2008 6:12 pm

problem to execute shell command in php

Post by rockobop »

Hello everyone

I am trying to do my q users can change the password

with the following

Code: Select all

 
$con=ssh2_connect('192.168.0.1', 22);
ssh2_auth_password($con, "user", "password");
$shell=ssh2_shell($con, 'xterm');
fwrite( $shell, "passwd login\n");
fwrite( $shell, "mdp courant\n");
fwrite( $shell, "test\n");
fwrite( $shell, "test\n"); 
 


as quoted on this page

http://forum.ubuntu-fr.org/viewtopic.php?id=197425

but my French and English is bad and can not translate well, I do not know if MKE could lend a hand

excuse my bad English

greetings
rockobop
Forum Newbie
Posts: 8
Joined: Thu Aug 28, 2008 6:12 pm

Re: problem to execute shell command in php

Post by rockobop »

any suggestion?
User avatar
starram
Forum Commoner
Posts: 58
Joined: Thu Apr 10, 2008 1:27 am
Location: India
Contact:

Re: problem to execute shell command in php

Post by starram »

Please elaborate, what exactly you want to do.
rockobop
Forum Newbie
Posts: 8
Joined: Thu Aug 28, 2008 6:12 pm

Re: problem to execute shell command in php

Post by rockobop »

change the password for my Linux users through interface php
rockobop
Forum Newbie
Posts: 8
Joined: Thu Aug 28, 2008 6:12 pm

Re: problem to execute shell command in php

Post by rockobop »

any suggestion?
Post Reply