Jump to content

Parsing 'passwd' in PHP


ChrisMartino

Recommended Posts

Hey there thanks again for your time reading this thread!.

 

So here's my issue,

 

I have a include I found on the internet that is very handy for sending commands to a machine if the host doesn't have SSH2 installed, now my problem is that I haven't got a clue how to parse passwd due to the fact that it's a prompt on the console, here's the include that I use:

 

http://phpseclib.sourceforge.net

 

And a example of how I run a command:

 

$ssh = new Net_SSH2('www.domain.tld');
if (!$ssh->login('username', 'password')) {
        exit('Login Failed');
}

$ssh->exec('adduser HelloWorld');

echo $ssh->exec('uptime');

 

But how would I run passwd?, thanks for your time.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.