🐘
Test.php
← Back
šŸ“ Php ⚔ Executable Ctrl+S: Save • Ctrl+R: Run • Ctrl+F: Find
<?php // --- SIMPLE BROWSER-RUNNABLE SFTP TEST --- $host = '108.61.85.3'; $port = 22; $username = 'newadmin'; $password = 'devbrewing21'; echo "<pre>Connecting to $host:$port...\n"; $conn = @ssh2_connect($host, $port); if (!$conn) { die("āŒ Could not connect to $host:$port\n</pre>"); } if (!@ssh2_auth_password($conn, $username, $password)) { die("āŒ Authentication failed for user $username\n</pre>"); } echo "āœ… Connected and authenticated successfully!\n"; $sftp = @ssh2_sftp($conn); if (!$sftp) { die("āŒ Failed to start SFTP subsystem\n</pre>"); } echo "āœ… SFTP subsystem started!\n\n"; // List remote home directory $handle = @opendir("ssh2.sftp://$sftp/."); if (!$handle) { die("āŒ Could not open remote directory\n</pre>"); } echo "šŸ“‚ Remote directory listing:\n"; while (false !== ($file = readdir($handle))) { echo " - $file\n"; } closedir($handle); echo "\nāœ… Done!</pre>"; ?>