Cannot login over ssh

Clash Royale CLAN TAG#URR8PPP
I created user accounts on my linux server, then I disabled password logins. I configured ssh to not accept password logins and only accept ssh. I configured the ufw firewall and forgot to allow ssh port. So now I cannot login as no incoming connections are accepted, is there any thing I can do to reset this? The OS running is Ubuntu 14.04 LTS release and it is running inside a VirtualBox vm.
sshd ufw
add a comment |
I created user accounts on my linux server, then I disabled password logins. I configured ssh to not accept password logins and only accept ssh. I configured the ufw firewall and forgot to allow ssh port. So now I cannot login as no incoming connections are accepted, is there any thing I can do to reset this? The OS running is Ubuntu 14.04 LTS release and it is running inside a VirtualBox vm.
sshd ufw
add a comment |
I created user accounts on my linux server, then I disabled password logins. I configured ssh to not accept password logins and only accept ssh. I configured the ufw firewall and forgot to allow ssh port. So now I cannot login as no incoming connections are accepted, is there any thing I can do to reset this? The OS running is Ubuntu 14.04 LTS release and it is running inside a VirtualBox vm.
sshd ufw
I created user accounts on my linux server, then I disabled password logins. I configured ssh to not accept password logins and only accept ssh. I configured the ufw firewall and forgot to allow ssh port. So now I cannot login as no incoming connections are accepted, is there any thing I can do to reset this? The OS running is Ubuntu 14.04 LTS release and it is running inside a VirtualBox vm.
sshd ufw
sshd ufw
edited Dec 20 '18 at 22:23
Rui F Ribeiro
39.1k1479130
39.1k1479130
asked Aug 31 '15 at 11:21
Sanik
83
83
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Recovery is similar to a lost root password (and might be easiest).
connect to the console of your VM, using virtual box.
a. if you can log from there, log as user, then sudo root, then edit sshd (and firewall rules) and reboot.
b. if you can't log, neither root/nor user, reboot hosts, upon boot, select kernel (using arrows), edit (using e), then add
init=/bin/bashto kernel line.remount
/and/usr, then editsshd_configmount -o remount,rw /
mount /usr
vi /etc/ssh/sshd_config
vi /etc/passwd # see bellow
vi /fire/wall/rules # (sic)
reboot
lost root password ?
to recover a lost root password, once you are in step 3.
passwd rootvi /etc/shadow, edit line likeroot:$6:salt$crypted:...remove$6$...up to but not including:(this will allow login with no password).
Hi archemar, I forgot to mention one more very important thing I am using Vagrant which is using VirtualBox so how can I connect to the console of the VM, because with vagrant I can connect only over ssh. Sorry for framing the question incorrectly
– Sanik
Aug 31 '15 at 12:48
How do you build you VM ? how do you power it off/on ? How do you add disk/LAN ? in this place you will find the console I told you about.
– Archemar
Aug 31 '15 at 13:52
Thanks, archemar found the console and followed the steps you provided, problem solved :)
– Sanik
Sep 1 '15 at 8:39
add a comment |
Try
$ sudo ufw allow ssh/tcp
$ sudo ufw logging on
$ sudo ufw enable
$ sudo ufw status
If this does not help go to /etc/hosts.allow add sshd: ALLOW: ALL and restart the sshd, disable the firewall before restarting the sshd
Hi, lucifer I am running Ubuntu 14.04 LTS release through vagrant and because I configured ubuntu to block all incoming connections, I just cannot run the simple command "vagrant ssh" to connect to the linux vm. So I cannot run the commands you mentioned above at all.
– Sanik
Aug 31 '15 at 12:50
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
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: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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%2funix.stackexchange.com%2fquestions%2f226574%2fcannot-login-over-ssh%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Recovery is similar to a lost root password (and might be easiest).
connect to the console of your VM, using virtual box.
a. if you can log from there, log as user, then sudo root, then edit sshd (and firewall rules) and reboot.
b. if you can't log, neither root/nor user, reboot hosts, upon boot, select kernel (using arrows), edit (using e), then add
init=/bin/bashto kernel line.remount
/and/usr, then editsshd_configmount -o remount,rw /
mount /usr
vi /etc/ssh/sshd_config
vi /etc/passwd # see bellow
vi /fire/wall/rules # (sic)
reboot
lost root password ?
to recover a lost root password, once you are in step 3.
passwd rootvi /etc/shadow, edit line likeroot:$6:salt$crypted:...remove$6$...up to but not including:(this will allow login with no password).
Hi archemar, I forgot to mention one more very important thing I am using Vagrant which is using VirtualBox so how can I connect to the console of the VM, because with vagrant I can connect only over ssh. Sorry for framing the question incorrectly
– Sanik
Aug 31 '15 at 12:48
How do you build you VM ? how do you power it off/on ? How do you add disk/LAN ? in this place you will find the console I told you about.
– Archemar
Aug 31 '15 at 13:52
Thanks, archemar found the console and followed the steps you provided, problem solved :)
– Sanik
Sep 1 '15 at 8:39
add a comment |
Recovery is similar to a lost root password (and might be easiest).
connect to the console of your VM, using virtual box.
a. if you can log from there, log as user, then sudo root, then edit sshd (and firewall rules) and reboot.
b. if you can't log, neither root/nor user, reboot hosts, upon boot, select kernel (using arrows), edit (using e), then add
init=/bin/bashto kernel line.remount
/and/usr, then editsshd_configmount -o remount,rw /
mount /usr
vi /etc/ssh/sshd_config
vi /etc/passwd # see bellow
vi /fire/wall/rules # (sic)
reboot
lost root password ?
to recover a lost root password, once you are in step 3.
passwd rootvi /etc/shadow, edit line likeroot:$6:salt$crypted:...remove$6$...up to but not including:(this will allow login with no password).
Hi archemar, I forgot to mention one more very important thing I am using Vagrant which is using VirtualBox so how can I connect to the console of the VM, because with vagrant I can connect only over ssh. Sorry for framing the question incorrectly
– Sanik
Aug 31 '15 at 12:48
How do you build you VM ? how do you power it off/on ? How do you add disk/LAN ? in this place you will find the console I told you about.
– Archemar
Aug 31 '15 at 13:52
Thanks, archemar found the console and followed the steps you provided, problem solved :)
– Sanik
Sep 1 '15 at 8:39
add a comment |
Recovery is similar to a lost root password (and might be easiest).
connect to the console of your VM, using virtual box.
a. if you can log from there, log as user, then sudo root, then edit sshd (and firewall rules) and reboot.
b. if you can't log, neither root/nor user, reboot hosts, upon boot, select kernel (using arrows), edit (using e), then add
init=/bin/bashto kernel line.remount
/and/usr, then editsshd_configmount -o remount,rw /
mount /usr
vi /etc/ssh/sshd_config
vi /etc/passwd # see bellow
vi /fire/wall/rules # (sic)
reboot
lost root password ?
to recover a lost root password, once you are in step 3.
passwd rootvi /etc/shadow, edit line likeroot:$6:salt$crypted:...remove$6$...up to but not including:(this will allow login with no password).
Recovery is similar to a lost root password (and might be easiest).
connect to the console of your VM, using virtual box.
a. if you can log from there, log as user, then sudo root, then edit sshd (and firewall rules) and reboot.
b. if you can't log, neither root/nor user, reboot hosts, upon boot, select kernel (using arrows), edit (using e), then add
init=/bin/bashto kernel line.remount
/and/usr, then editsshd_configmount -o remount,rw /
mount /usr
vi /etc/ssh/sshd_config
vi /etc/passwd # see bellow
vi /fire/wall/rules # (sic)
reboot
lost root password ?
to recover a lost root password, once you are in step 3.
passwd rootvi /etc/shadow, edit line likeroot:$6:salt$crypted:...remove$6$...up to but not including:(this will allow login with no password).
edited May 30 '16 at 22:07
techraf
4,153102139
4,153102139
answered Aug 31 '15 at 11:42
Archemar
19.6k93570
19.6k93570
Hi archemar, I forgot to mention one more very important thing I am using Vagrant which is using VirtualBox so how can I connect to the console of the VM, because with vagrant I can connect only over ssh. Sorry for framing the question incorrectly
– Sanik
Aug 31 '15 at 12:48
How do you build you VM ? how do you power it off/on ? How do you add disk/LAN ? in this place you will find the console I told you about.
– Archemar
Aug 31 '15 at 13:52
Thanks, archemar found the console and followed the steps you provided, problem solved :)
– Sanik
Sep 1 '15 at 8:39
add a comment |
Hi archemar, I forgot to mention one more very important thing I am using Vagrant which is using VirtualBox so how can I connect to the console of the VM, because with vagrant I can connect only over ssh. Sorry for framing the question incorrectly
– Sanik
Aug 31 '15 at 12:48
How do you build you VM ? how do you power it off/on ? How do you add disk/LAN ? in this place you will find the console I told you about.
– Archemar
Aug 31 '15 at 13:52
Thanks, archemar found the console and followed the steps you provided, problem solved :)
– Sanik
Sep 1 '15 at 8:39
Hi archemar, I forgot to mention one more very important thing I am using Vagrant which is using VirtualBox so how can I connect to the console of the VM, because with vagrant I can connect only over ssh. Sorry for framing the question incorrectly
– Sanik
Aug 31 '15 at 12:48
Hi archemar, I forgot to mention one more very important thing I am using Vagrant which is using VirtualBox so how can I connect to the console of the VM, because with vagrant I can connect only over ssh. Sorry for framing the question incorrectly
– Sanik
Aug 31 '15 at 12:48
How do you build you VM ? how do you power it off/on ? How do you add disk/LAN ? in this place you will find the console I told you about.
– Archemar
Aug 31 '15 at 13:52
How do you build you VM ? how do you power it off/on ? How do you add disk/LAN ? in this place you will find the console I told you about.
– Archemar
Aug 31 '15 at 13:52
Thanks, archemar found the console and followed the steps you provided, problem solved :)
– Sanik
Sep 1 '15 at 8:39
Thanks, archemar found the console and followed the steps you provided, problem solved :)
– Sanik
Sep 1 '15 at 8:39
add a comment |
Try
$ sudo ufw allow ssh/tcp
$ sudo ufw logging on
$ sudo ufw enable
$ sudo ufw status
If this does not help go to /etc/hosts.allow add sshd: ALLOW: ALL and restart the sshd, disable the firewall before restarting the sshd
Hi, lucifer I am running Ubuntu 14.04 LTS release through vagrant and because I configured ubuntu to block all incoming connections, I just cannot run the simple command "vagrant ssh" to connect to the linux vm. So I cannot run the commands you mentioned above at all.
– Sanik
Aug 31 '15 at 12:50
add a comment |
Try
$ sudo ufw allow ssh/tcp
$ sudo ufw logging on
$ sudo ufw enable
$ sudo ufw status
If this does not help go to /etc/hosts.allow add sshd: ALLOW: ALL and restart the sshd, disable the firewall before restarting the sshd
Hi, lucifer I am running Ubuntu 14.04 LTS release through vagrant and because I configured ubuntu to block all incoming connections, I just cannot run the simple command "vagrant ssh" to connect to the linux vm. So I cannot run the commands you mentioned above at all.
– Sanik
Aug 31 '15 at 12:50
add a comment |
Try
$ sudo ufw allow ssh/tcp
$ sudo ufw logging on
$ sudo ufw enable
$ sudo ufw status
If this does not help go to /etc/hosts.allow add sshd: ALLOW: ALL and restart the sshd, disable the firewall before restarting the sshd
Try
$ sudo ufw allow ssh/tcp
$ sudo ufw logging on
$ sudo ufw enable
$ sudo ufw status
If this does not help go to /etc/hosts.allow add sshd: ALLOW: ALL and restart the sshd, disable the firewall before restarting the sshd
edited Aug 31 '15 at 11:57
answered Aug 31 '15 at 11:53
RockySAnand
13
13
Hi, lucifer I am running Ubuntu 14.04 LTS release through vagrant and because I configured ubuntu to block all incoming connections, I just cannot run the simple command "vagrant ssh" to connect to the linux vm. So I cannot run the commands you mentioned above at all.
– Sanik
Aug 31 '15 at 12:50
add a comment |
Hi, lucifer I am running Ubuntu 14.04 LTS release through vagrant and because I configured ubuntu to block all incoming connections, I just cannot run the simple command "vagrant ssh" to connect to the linux vm. So I cannot run the commands you mentioned above at all.
– Sanik
Aug 31 '15 at 12:50
Hi, lucifer I am running Ubuntu 14.04 LTS release through vagrant and because I configured ubuntu to block all incoming connections, I just cannot run the simple command "vagrant ssh" to connect to the linux vm. So I cannot run the commands you mentioned above at all.
– Sanik
Aug 31 '15 at 12:50
Hi, lucifer I am running Ubuntu 14.04 LTS release through vagrant and because I configured ubuntu to block all incoming connections, I just cannot run the simple command "vagrant ssh" to connect to the linux vm. So I cannot run the commands you mentioned above at all.
– Sanik
Aug 31 '15 at 12:50
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- 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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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%2funix.stackexchange.com%2fquestions%2f226574%2fcannot-login-over-ssh%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