Link to home
Create AccountLog in
Avatar of marchopkins
marchopkinsFlag for United States of America

asked on

SSHD will not stay running

Using Linux ES 6  Unable to get SSHD to stay started.      Using        service sshd start     or   restart   starts it but it goes right back to being stopped.

any thoughts?
ASKER CERTIFIED SOLUTION
Avatar of Martyn Spencer
Martyn Spencer
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of marchopkins

ASKER

Ill give this a go and let you know...thanks
Diagnostics may live in /var/log/messages or /var/log/secure or somewhere else.

Easy test.

service sshd restart
/bin/ls -lrt /var/log/*

Open in new window


Which will show your the most recently changed files last.

Then look for the sshd failure message + fix whatever problem is reported.

If your starting a new project, start with Ubuntu Bionic instead of ES X, as all the ES images contain outdated Kernels.
Got it..I found the issue...I was recently re-IPing the device and found that the ssh IP need to be changed as well.

SSHD is up and running....The only problem i have now is IP tables.   with them running, i cannot SSH to it...with them stopped...no problems.  I'll close this question as you were perfect with the answer.  If you have thoughts on the IPtables...i could use some help there too.
thanks to both of you...the first solution led me to the fix...thanks.
Great to hear that you fixed it. What rules do you have in iptables for port 22?
4    DROP       tcp  --  0.0.0.0/0            63.XXX.XXX.0/24     tcp dpt:22
5    ACCEPT     tcp  --  0.0.0.0/0            10.0.0.0/24         state NEW tcp dpt:22


are the only two Port 22 entries I have.
I am going to respond to this question, which I presume is related.
Tip: In your /etc/ssh/sshd_config file (or where ever this file is located on your Distro), remove the hard coded IP + use 0.0.0.0 so when you migrate your config, your config will work on any machine.

So use...

ListenAddress ::
ListenAddress 0.0.0.0

Open in new window


Or just take the default + leave these commented out, so sshd listens on all interfaces.