0

Let's say the /etc/sysconfig/iptables needs to be edited because, due to it I can not ssh to my server.

I start my server in "Rescue Mode", but when I login, there is no such thing as /etc/sysconfig/iptables to edit.

What can be done so I can edit that file from this rescue mode? Or at least, is there a way to reboot the system while ensuring, iptables is not started, while inside of the rescue mode?

Braiam
  • 35,991
  • 1
    Have you tried the grub trick init=bash... # mount -o remount,rw / – Red Cricket Aug 19 '14 at 05:41
  • @user79634 please update the question with what distro and version you are using. And also the details of configuration changes you might have made earlier. – beginer Aug 19 '14 at 08:26

2 Answers2

1

If you have a CD with an installation image or a rescue system image, then boot that, mount the root partition and edit whatever you need.

countermode
  • 7,533
  • 5
  • 31
  • 58
-2

init=/bin/bash

But you may try to boot in "single user" mode by adding command "1" to boot loader at boot time. Looks like:

kernel /boot/vmlin... 1

All filesystems will be mounted automatically in normal mode. Then you may fix your /etc/sysconfig/iptables config file.

http://www.tecmint.com/linux-kernel-boot-time-parameters-explained/ http://redsymbol.net/linux-kernel-boot-parameters/

  • I guess you should clearly read the question first. I didnt find even the word iptables in those links. – beginer Aug 19 '14 at 08:21
  • Oops... /root is mounted but no config found. Is it correct? Very strange. But if you sure iptables has block network access you may add exit as a second line in /etc/init.d/iptables and restart. – EvilAdmin Aug 19 '14 at 09:09