Cannot connect to machine via SSH after adjusting config and removing `70-persistent-net.rules`
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
add a comment |
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
1
I believe my answer solved your problem with the service itself and nowsystemctl status ssh.service
returnsactive (running)
. TheConnection 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 thessh.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
add a comment |
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
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
ssh
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 nowsystemctl status ssh.service
returnsactive (running)
. TheConnection 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 thessh.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
add a comment |
1
I believe my answer solved your problem with the service itself and nowsystemctl status ssh.service
returnsactive (running)
. TheConnection 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 thessh.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
add a comment |
1 Answer
1
active
oldest
votes
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
Thanks, that fixed thesudo 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
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
Thanks, that fixed thesudo 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
add a comment |
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
Thanks, that fixed thesudo 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
add a comment |
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
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
edited Jan 13 at 4:44
answered Jan 13 at 4:23
Kamil MaciorowskiKamil Maciorowski
27.3k155982
27.3k155982
Thanks, that fixed thesudo 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
add a comment |
Thanks, that fixed thesudo 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
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
1
I believe my answer solved your problem with the service itself and now
systemctl status ssh.service
returnsactive (running)
. TheConnection 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 thessh.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