LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 12-09-2015, 08:11 AM   #1
jonaskellens
Member
 
Registered: Jul 2008
Location: Ghent, Belgium
Distribution: Fedora, CentOS
Posts: 632

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


Hello

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

My php code :
Code:
include '../../includes/phpseclib/Net/SFTP.php';
//Create your connection
$host="01.02.03.04"; // test-server
$port="2273";
//Login
$user="myUser";
$pass="myPasswd";
$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 01.02.03.04: 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.


Thanks.
 
Old 12-09-2015, 08:38 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,577
Blog Entries: 14

Rep: Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969
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.
 
  


Reply


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 07:40 AM
Starting sshd: /etc/init.d/sshd: line 113: /usr/sbin/sshd: Permission denied sumanc Linux - Server 5 03-28-2008 05:59 AM
Looking for php script to keep track of payments received michaeljoser Linux - Software 3 11-05-2007 07:26 AM
FC4-Starting sshd: Privilege separation user sshd does not exist FAILED kiranherekar Fedora 5 12-29-2005 03:22 PM


All times are GMT -5. The time now is 06:36 AM.

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