Jump to content

Search the Community

Showing results for tags 'ssh2'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 2 results

  1. Provider changed there security settings and now I am not able to connect. I get this error "ssh2_connect(): Error starting up SSH connection(-5): Unable to exchange encryption keys " these are the keys they except now. how to I tell ssh_connect() to use one of these try { $connection = ssh2_connect($db['cit_host'], $port); if(!$connection){ throw new \Exception("Could not connect to $host on port $port"); } $auth = ssh2_auth_password($connection, $user, $pass); if(!$auth){ throw new \Exception("Could not authenticate with username $user and password "); } $sftp = ssh2_sftp($connection); if(!$sftp){ throw new \Exception("Could not initialize SFTP subsystem."); } $stream = fopen("ssh2.sftp://" .(int)$sftp.'//Inbox//'.$remoteFile, 'w'); if (! $stream) { echo "<td>$sftp$remoteFile</td>"; throw new \Exception("Could not open file: "); } $file = file_get_contents($remoteFile); if (fwrite($stream, $file) ===FALSE){ echo "File Not Written";
  2. Hi, I have the below code to get tput from a remote server, $connection = ssh2_connect('x.x.x.x', 22 ); if( !$connection )die( 'Can not Connect' ); if( ssh2_auth_password( $connection, 'user', 'pass' ) ) { echo "Password Correct<br/>"; }else{ echo "Password Wrong<br/>"; } $out = ssh2_exec( $connection, 'ls '); echo $out; $err_stream = ssh2_fetch_stream( $out, SSH2_STREAM_STDERR ); $result_err = stream_get_contents( $err_stream ); echo $result_err; stream_set_blocking( $out, true ); while( $line = fgets($out) ){ flush(); echo $line; $content.=$line; } This code runs and outputs perfectly to my server if connected to the root user account. However, if I try to connect to other user accounts no output is shown. Again if I connect to my server using putty to the same user account and exicute the same command it shows output. Can anyone give me idea what can be the possible issue for this? Thanks in advanced.
×
×
  • 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.