LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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-14-2014, 08:04 AM   #1
JKF22
LQ Newbie
 
Registered: Nov 2014
Posts: 4

Rep: Reputation: Disabled
No SSH ports open


Hi everyone,

I'm not quite a newbie but not all that experienced with Linux... I have a Centos 6 VPS which i setup fine. Following some advice i read i changed the SSH port from 22 to 22123 (for example)...

Everything was fine for a while, i then left this server for a week, now going back to it i can't connect. I've done nmap on it and it doens't show any open SSH ports.

Does anyone have any advice from here on in? Its a cloud based VPS so i have no other way to connect other than SSH - is this a re-provision job? Or can it be saved?

Does anyone have any thoughts on changing ports, is it worth doing? Have i just done something wrong when changing this - followed the advice given and it did all work for a while after i set everything up.

Many thanks
 
Old 11-14-2014, 09:02 AM   #2
grubby
LQ Newbie
 
Registered: Oct 2014
Distribution: Centos 6.5
Posts: 16

Rep: Reputation: Disabled
Most VPS providers have some sort of rescue system in place. Look around in your customer panel on their website.
That will allow you to chroot your original disk, so you can check your config files.

That same screen probably will also give you a reboot option. Maybe your ssh daemon just crashed and a reboot will allow you to login again?


I don't think its bad advise to change the port. It will prevent a lot of brute force script kiddie attacks and keep your logs a bit cleaner.
 
Old 11-14-2014, 10:07 AM   #3
JKF22
LQ Newbie
 
Registered: Nov 2014
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thanks grubby...

I've spoken to my host, they confirmed there is a recovery login etc... There advice is to turn the server off, then use this recovery option to edit the iptables.

iptables is something i have no idea about really, can you or anyone give me any advice where to start with this to try and get SSH access back on?

Cheers
 
Old 11-14-2014, 02:44 PM   #4
Habitual
LQ 5k Club
 
Registered: Jan 2011
Location: Nowhere near you, thank God.
Distribution: OSX Sierra
Posts: 8,573
Blog Entries: 15

Rep: Reputation: Disabled
Quote:
Originally Posted by JKF22 View Post
Thanks grubby...

I've spoken to my host, they confirmed there is a recovery login etc... There advice is to turn the server off, then use this recovery option to edit the iptables.

iptables is something i have no idea about really, can you or anyone give me any advice where to start with this to try and get SSH access back on?

Cheers
Wow, iptables are memory-resident only, so unless they are "persistent" somehow, rebooting should clear them.
They may be saved in /etc/sysconfig/iptables, so moving this file in a recovery environment may be sufficient.
I say "move" so they can be reviewed later.

Code:
mv /etc/sysconfig/iptables /root/safe.rules
and a reboot should take care of it.
You may also wish to view /etc/iptables/rules.v4 if it exists, and move that also to /root/<something_clever>

After moving, reboot and see what's what.

Others may have more information or even another method to accomplish this task.
 
  


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] checking for open ports need ports 5198, 5199 open for UDP raypsi Linux - Security 9 05-22-2012 07:51 PM
SSH connection through the firewall with no ports open Vitoriung Linux - Networking 7 10-06-2009 11:51 AM
Cannot Open Mail Server Ports 25, 110, and 220. Other Ports will open. Binxter Linux - Newbie 9 11-29-2007 03:03 AM
open ports on linksys, i have ssh open but thats it PlatinumRik Linux - Security 1 07-07-2005 11:38 AM
telnet, ssh, open ports wulf Linux - Networking 5 06-26-2003 01:23 PM

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

All times are GMT -5. The time now is 03:45 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration