Report this

What is the reason for this report?

Can't run sshd in debug mode

Posted on May 16, 2017

I have a CentOS 7 droplet. I want to debug sshd. I stop the sshd service. And then do /usr/sbin/sshd -d. I get an error that connection is refused by the tcp wrapper.

Screenshot of sshd console output is here: https://snag.gy/l0HKiL.jpg

I’ve looked at these two articles and googled a bunch but no luck.

https://lists.debian.org/debian-user/2003/04/msg03552.html https://www.akadia.com/services/ssh_tcp_wrapper.html

I imagine that the problem has something to do with what’s in my /etc/hosts.allow or /etc/hosts.deny. I tried adding an entry into the empty hosts.allow:

sshd: localhost

No luck.

/etc/hosts.deny just has a pile of entries for IPs that have been denied.

I am able to ssh to localhost from the droplet so the problem is more subtle than the machine being blocked from ssh’ing to itself.

Thanks. Sol



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

@digitalocean3a334a72f3e85e

Have you tried running SSH on another port as a part of the command?

i.e.

sudo /usr/sbin/sshd -ddd -p 2200

You don’t have to specifically use 2200, any port that’s open and not in use should work.

The added d’s simply increase the verbosity of the output.

Heya all,

In such cases I’ll recommend to try and clear the hosts.deny file for some time and try to connect SSH or whatever your aim is.

Most of the time the issue is coming from such blocks that were added down the road for some reasons that might not be vaild anymore.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.