LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-27-2014, 12:19 PM   #1
Highjo
Member
 
Registered: Jan 2007
Posts: 36

Rep: Reputation: 0
Unhappy How to fix firewall issues when in recovery mode? ssh port seems blocked


Hello I think I have mistakenly locked myself from a remote server (ssh).There is no way to physically log into that server but I had a way to restart in recovery mode (unmanaged dedicated hosting) but it seems ufw is not even installed when in recovery mode. should I follow serverfault post about using purely iptables script to be run at boot time?

I have no ufw folder under /etc/default nor under /etc/

Best Regards,
 
Old 05-28-2014, 01:31 AM   #2
GunFighT
Member
 
Registered: May 2014
Location: Romania
Distribution: Debian/Ubuntu, Rocky Linux
Posts: 53

Rep: Reputation: Disabled
1st of all, You sould also check in rc.local, it there are some rulles in there for the firewall, or maybe the rulles are in the default config file on firewall.
2nd, try do modify the rulles in iptables from safe mode.

I`ve maked my own firewall, like example: Firewall.sh, with chmod +x Firewall.sh, so I can execute it, posted the rulles of firewall there, and added in rc.local.
The begining of my firewall lookes like this:

Code:
### Remove all previous rules, and delete any user defined chains ###
iptables -X
iptables -F
iptables -t nat -X
iptables -t nat -F
iptables -t mangle -X
iptables -t mangle -F
Code:
#### Set the default policies to drop ###
iptables -P INPUT DROP
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT

The rest of rulles what I`ve didn`t posted, are the rulles for accept/deny ports, ip`s, etc.
 
Old 06-24-2014, 02:13 AM   #3
Highjo
Member
 
Registered: Jan 2007
Posts: 36

Original Poster
Rep: Reputation: 0
Hello Sorry for the late response.

I got it fixed. Thanks
 
  


Reply



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
Port 80 Blocked. Connects only from itself. Firewall and SELinux are off. Fedora 8 gumbojmg Fedora 8 09-12-2010 03:46 PM
I blocked SSH 22 port with IPtables seryi Linux - General 7 02-02-2010 07:43 PM
SSH over internet local port blocked konqi Linux - Networking 19 12-09-2009 06:23 AM
SSH help/blocked port YellowFin Linux - Networking 2 09-29-2005 04:25 PM
SSH & IRC Ports beying blocked by integrated firewall on RH9 ronnybello Linux - Networking 5 08-23-2003 08:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:32 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
Open Source Consulting | Domain Registration