2

I'm connecting with phpsеclib like that:

<?php
include('Net/SSH2.php');

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

echo $ssh->read('username@username:~$');
$ssh->write("some commands"); // here is the question
echo $ssh->read('username@username:~$');
?>

And I wаnt to check if my ssh still can tunnel traffic and get external ip.

By еxternal ip I mean the IP we will get after connection (sometimes it's different from IP tо which we connect).

peterh
  • 4,914
  • 13
  • 29
  • 44
  • Possible duplicate of [Finding the Public IP address in a shell script](http://serverfault.com/questions/89114/finding-the-public-ip-address-in-a-shell-script) – cnst Oct 11 '15 at 21:15
  • little bit different issue, I've to check if tunneling is available, then, if it's available, check for ip – Alex Wisdom Oct 11 '15 at 21:27

0 Answers0