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?
marchopkinsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Martyn SpencerManaging DirectorCommented:
What do you see in your system logs? What is shown in /var/log/secure immediately after it fails? You could try
cat /var/log/secure | grep sshd

Open in new window

It may give you a clue as to why it is failing. Possibly there is a configuration issue.

Don't post any logs publicly unless you sanitise them first (remove IP addresses, user names etc).
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
marchopkinsAuthor Commented:
Ill give this a go and let you know...thanks
0
David FavorLinux/LXD/WordPress/Hosting SavantCommented:
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.
0
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

marchopkinsAuthor Commented:
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.
0
marchopkinsAuthor Commented:
thanks to both of you...the first solution led me to the fix...thanks.
0
Martyn SpencerManaging DirectorCommented:
Great to hear that you fixed it. What rules do you have in iptables for port 22?
0
marchopkinsAuthor Commented:
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.
0
Martyn SpencerManaging DirectorCommented:
I am going to respond to this question, which I presume is related.
0
David FavorLinux/LXD/WordPress/Hosting SavantCommented:
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.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.