LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-24-2017, 12:09 AM   #1
goblin_rocket
LQ Newbie
 
Registered: Nov 2017
Posts: 14

Rep: Reputation: Disabled
Cant ssh into Centos7 virtualbox after changing run level


I was making some changes to the run level in a Centos7 VM in Virtualbox, I changed it to run level 0 but then changed it back to 3 and restarted but I am now unable to ssh into it remotely.

I have verified that the runlevel is back at 3 and rebooted several times now and still cant ssh in with any user, it just time out every time.

thanks
 
Old 11-24-2017, 02:21 AM   #2
TheEzekielProject
Member
 
Registered: Dec 2016
Distribution: arch
Posts: 664

Rep: Reputation: 190Reputation: 190
Have you tried adding the -v option to your ssh attempts???


Try -vvv for more output!

EDIT: That's three (3) lower case V's

Last edited by TheEzekielProject; 11-24-2017 at 02:23 AM.
 
Old 11-24-2017, 03:40 AM   #3
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,513

Rep: Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009
Just check the VM to see if the networking and ssh processes are running.
 
Old 11-24-2017, 05:58 AM   #4
goblin_rocket
LQ Newbie
 
Registered: Nov 2017
Posts: 14

Original Poster
Rep: Reputation: Disabled
this is the -vvv output

$ ssh root@192.168.1.52 -vvv
OpenSSH_7.5p1, OpenSSL 1.0.2l 25 May 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug2: resolving "192.168.1.52" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to 192.168.1.52 [192.168.1.52] port 22.
debug1: connect to address 192.168.1.52 port 22: Connection timed out
ssh: connect to host 192.168.1.52 port 22: Connection timed out


I will check VM settings now
 
Old 11-24-2017, 07:39 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 21,589

Rep: Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163
How is the VM network adapter configured?

Are you using the correct IP address?

The firewall default allows ssh traffic so if it was running you should be able to connect.

Just as an FYI run levels in systemd are "obselete". An equivalent is:
0 = poweroff.target
1 = rescue.target
2,3,4 = multiuser.target
5 = graphical.target
6 = reboot.target
 
Old 11-24-2017, 07:43 AM   #6
goblin_rocket
LQ Newbie
 
Registered: Nov 2017
Posts: 14

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
How is the VM network adapter configured?

Are you using the correct IP address?

The firewall default allows ssh traffic so if it was running you should be able to connect.

Just as an FYI run levels in systemd are "obselete". An equivalent is:
0 = poweroff.target
1 = rescue.target
2,3,4 = multiuser.target
5 = graphical.target
6 = reboot.target
I have the network adapter setup as a bridge adapter, but I havent changed anything at all in the VMBox settings. All I did was do 'init 0' and then I changed that back later to 3 but now cant get back in, checked /etc/inittab and also /sshd_config and I cant see anything in those that could be stopping me from ssh-ing into the box now....
 
Old 11-24-2017, 08:04 AM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 21,589

Rep: Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163
Running the command init 0 should of powered off the VM. No settings were changed.

You can check ssh status via the command.
systemctl status sshd

You can also verify ssh is working within the VM by trying to login to itself.

ssh localhost
 
Old 11-24-2017, 10:32 AM   #8
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.8.2003
Posts: 5,432

Rep: Reputation: 2055Reputation: 2055Reputation: 2055Reputation: 2055Reputation: 2055Reputation: 2055Reputation: 2055Reputation: 2055Reputation: 2055Reputation: 2055Reputation: 2055
My guess is that sshd is not running. Probably it was set up and started, but not "enabled," so it doesn't start at boot.
Clue is "Connection Timed Out" -- means there's no daemon listening on port 22.

Just a guess, tho. What does
Code:
ss -tnl
show?
 
Old 11-25-2017, 07:55 PM   #9
goblin_rocket
LQ Newbie
 
Registered: Nov 2017
Posts: 14

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
Running the command init 0 should of powered off the VM. No settings were changed.

You can check ssh status via the command.
systemctl status sshd

You can also verify ssh is working within the VM by trying to login to itself.

ssh localhost
you were right it was the ip, I have two boxes on ips ending 54 and 55 but they seem to have changed to 57 and 58 so I guess I didnt setup the static ips correctly.

Solved, thank you!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Sound on Dell Latitude D620 won't work in run level 4 but it will in run level 3. Arcosanti Slackware 3 09-07-2015 11:52 AM
Small tip: use run level 2 as a customized run level 3 to boot faster Didier Spaier Slackware 3 01-14-2015 06:14 AM
Changing from run level 3 to 4 and back boots to the kde desktop. Sevenjen0 Slackware 5 04-01-2012 08:37 PM
changing run level scofiled83 Programming 3 11-09-2008 03:57 AM
Changing Fedora RUN LEVEL 3? carlosinfl Fedora 5 01-29-2005 06:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration