Cannot connect to machine via SSH after adjusting config and removing `70-persistent-net.rules`












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.










share|improve this question




















  • 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 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 at 5:06
















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.










share|improve this question




















  • 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 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 at 5:06














0












0








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.










share|improve this question
















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.







ssh






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 13 at 4:55









JakeGould

31.4k1096138




31.4k1096138










asked Jan 13 at 3:57









Bo WorkBo Work

32




32








  • 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 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 at 5:06














  • 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 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 at 5:06








1




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 at 4:56







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 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 at 5:06





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 at 5:06










1 Answer
1






active

oldest

votes


















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





share|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 at 4:28













Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1393675%2fcannot-connect-to-machine-via-ssh-after-adjusting-config-and-removing-70-persis%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









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





share|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 at 4:28


















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





share|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 at 4:28
















2












2








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





share|improve this answer















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






share|improve this answer














share|improve this answer



share|improve this answer








edited Jan 13 at 4:44

























answered Jan 13 at 4:23









Kamil MaciorowskiKamil Maciorowski

27.3k155982




27.3k155982













  • 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 at 4:28





















  • 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 at 4:28



















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 at 4:28







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 at 4:28




















draft saved

draft discarded




















































Thanks for contributing an answer to Super User!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1393675%2fcannot-connect-to-machine-via-ssh-after-adjusting-config-and-removing-70-persis%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Plaza Victoria

Puebla de Zaragoza

Musa