0

Currently, when I try to reload SSH via sudo service ssh force-reload, I get ssh.service is not active, cannot reload.

Currently, when I try to ssh to pwnable.kr, I get:

ssh: connect to host pwnable.kr port 2222: Connection refused.

I had an issue of Write Failed: broken pipe when SSHing before, so I followed StackOverflow advice and changed ServerAliveInterval to 120, ServerAliveInterval 30, ServerAliveCountMax 5 all to no avail.

Therefore, I suspected SSH broke because of an IP conflict, because it didn't work on my Kali Linux VM but it did work on my Ubuntu.

Therefore, I followed other advice of:

sudo rm -f /etc/udev/rules.d/70-persistent-net.rules;
sudo reboot;

And here is where I am now. Now I've broken SSH on my Ubuntu and Kali Linux VM.

  • 1
    I believe my answer solved your problem with the service itself and now systemctl status ssh.service returns active (running). The Connection refused issue deserves a separate question. One issue, one question. Please see How to Ask and act accordingly. After you write a new question you should edit this one and only leave parts relevant to the ssh.service is not active, cannot reload problem. – Kamil Maciorowski Jan 13 '19 at 4:56
  • Or maybe even "before you write a new question you should edit this one…". This way no new answer appears here that would try to solve the other issue. – Kamil Maciorowski Jan 13 '19 at 5:06
2

ssh.service is not active, cannot reload means the service cannot react to your request to reload because it's not running at the moment. Confirm with

systemctl status ssh.service

To start it, invoke

systemctl start ssh.service

service command you used runs System V (legacy) init scripts from /etc/init.d/. Nowadays you should prefer systemctl. Instead of service ssh force-reload you should use

systemctl force-reload ssh.service

or equivalent

systemctl reload-or-try-restart ssh.service
| improve this answer | |
  • Thanks, that fixed the sudo service ssh force-reload problem! However, ssh: connect to host pwnable.kr port 2222: Connection refused. still occuring. Will probably just install mosh instead of ssh if everything else fails – Bo Work Jan 13 '19 at 4:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.