Avatar of marchopkins
marchopkins
Flag 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?
LinuxNetworking Protocols

Avatar of undefined
Last Comment
David Favor

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Martyn Spencer

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
marchopkins

ASKER
Ill give this a go and let you know...thanks
David Favor

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.
marchopkins

ASKER
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.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
marchopkins

ASKER
thanks to both of you...the first solution led me to the fix...thanks.
Martyn Spencer

Great to hear that you fixed it. What rules do you have in iptables for port 22?
marchopkins

ASKER
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.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Martyn Spencer

I am going to respond to this question, which I presume is related.
David Favor

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.