Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 12-09-2015, 07:11 AM   #1
Registered: Jul 2008
Location: Ghent, Belgium
Distribution: Fedora, CentOS
Posts: 674

Rep: Reputation: 34
php Net_SFTP : sshd[23996]: Received disconnect from 11:


I am using phpseclib library to put file on server. This works perfect on all servers except 1 !

My php code :
include '../../includes/phpseclib/Net/SFTP.php';
//Create your connection
$host=""; // test-server
$sftp = new Net_SFTP("$host:$port");
if (!$sftp->login($user, $pass)) {
   exit('Error 512 : Login failed'); // Login failed
} else {
This works well on all my servers. The file is put into the home directory of the user 'myUser'.

On 1 server this does not work.
I get 'Error 512 : Login failed'.
And on the server I see in /var/log/secure :

Dec 9 14:00:46 myserver sshd[23996]: Received disconnect from 11:

All my servers should be identical. I don't see the difference.

Can someone push me into the right direction? So I know what I'm searching for.

Old 12-09-2015, 07:38 AM   #2
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,804
Blog Entries: 15

Rep: Reputation: 1653Reputation: 1653Reputation: 1653Reputation: 1653Reputation: 1653Reputation: 1653Reputation: 1653Reputation: 1653Reputation: 1653Reputation: 1653Reputation: 1653
You might want to do a test with sftp from command line to see if it works (i.e. use sftp directly rather than the php script). If your script is working everywhere else it suggests the issue is with the destination server. Check permissions of the home directory of the user you're trying to login to on that remote as well as the .ssh subdirectory. SSH (and therefore sftp) will maddeningly refuse to connect if it thinks it isn't secure but will never tell you that is the reason.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange SSH brute force (many "Received disconnect [preauth]") simopal6 Linux - Security 5 11-04-2012 01:26 AM
php/HttpRequest/https: A TLS packet with unexpected length was received eantoranz Programming 1 05-30-2010 06:40 AM
Starting sshd: /etc/init.d/sshd: line 113: /usr/sbin/sshd: Permission denied sumanc Linux - Server 5 03-28-2008 04:59 AM
Looking for php script to keep track of payments received michaeljoser Linux - Software 3 11-05-2007 06:26 AM
FC4-Starting sshd: Privilege separation user sshd does not exist FAILED kiranherekar Fedora 5 12-29-2005 02:22 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:35 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration