Link to home
Start Free TrialLog in
Avatar of _paulie
_paulie

asked on

sshd has failed, please contact the sysadmin

Hello,

I'm currently having an issue connecting to my server via SFTP. The connection is working fine, however the client hangs during the authentication. I'm connecting to the server via SFTP using WinSCP. I have never had any issues until today. My local firewall is turned off. I don't have any antivirus or any other application that could be interfering with the connection. The SFTP connection was working fine until today. I also tried disabling IPtables in the remote server, but that did not help at all. The server has CentOS x86_64 and cPanel installed. I can see the sftp-server process being created during the connection. I'm getting the following information in /var/log/messages:

sftp-server[666]: session opened for local user x from [x.x.x.x]

I tried restarting SSHD via cPanel, however when I do that I get the following msg:


Waiting for sshd to restart...............finished.
sshd (/usr/sbin/sshd) running as root with PID 12670
sshd has failed, please contact the sysadmin.

After doing this, the SSH process works fine. I can connect to the SSH daemon without any problems. However the SFTP connection is not working as I stated above.

I'd appreciate any help with this.

If you need more information, please don't hesitate to ask me.

~paulie
Avatar of svgmuc
svgmuc
Flag of United States of America image

Might be a hanging sftp sub process... have you tried scp?
If that works, I'd check

> ps xa | grep sftp

after stopping  the sshd. If it shows a process, kill it.
If that doesn't work, you will have to reboot the machine.
Avatar of _paulie
_paulie

ASKER

Hello,

Thanks for your reply.

I tried that, the ps process is only returning the grep process.

Is rebooting the machine really necessary?

Do you by any chance have any idea of what the cause of the problem could be?

Thanks for your time.
Avatar of _paulie

ASKER

Hello,

I also tried connecting via SCP using WinSCP as client, but that did not work. WinSCP is getting stuck during the authentication.

Thanks
Well, you could ltrace the sshd process...
Avatar of _paulie

ASKER

Unfortunately, I've never done that before. Would you be kind to explain how it works? I'll follow your instructions carefully. Thank you!
Check if SElinux is enforcing by typing

> sestatus

Check, if you can connect locally to the sshd.

> ssh user@localhost

If you get no response use the verbose mode

> ssh -v user@localhost

Let's see if we can discern something from the output.
Avatar of _paulie

ASKER

SELinux status is disabled.

I tried connecting to the ssh daemon, but I'm not receiving any response. Here is the output:

OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to localhost [127.0.0.1] port 22

That's all it says.

Thank you!
Are you sure, the sshd is running?

Check via

> ps xa | grep sshd

If it only shows the grep or nothing at all, try to start it and check again.
If it doesn't work, please start sshd manually

> /usr/sbin/sshd -v

Does it tell you any reasons for aborting?
Avatar of _paulie

ASKER

Yes, sshd is running. When I try to connect to the sshd with -v it only prints the text i wrote above. If you wait 60 seconds, you get a time out error. Now the SFTP server seems to be working fine. I have no idea why it is working, but it's working. I did not restart sshd. I'm very confused.
ASKER CERTIFIED SOLUTION
Avatar of svgmuc
svgmuc
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial