To address the issues with the current operating system, you have a few options: asking those who made the modifications to revert the changes, reinstalling the server, or restoring from a backup if you know when the system was last stable. Here’s a detailed guide on using the rescue system to make necessary changes, considering the root partition is /dev/vdb1
.
Accessing the Rescue System
- Boot into Rescue Mode:
- Go to your admin interface and select the VPS.
- Choose “Enable Rescue Mode” from the menu, Insert the password
- Poweroff and login wuth root , the password you set and the server IP
- Mount the Installed Partition:
- Once in the rescue mode, create a mount point:
sh mkdir /mnt/sysimage
- Mount the root partition:
sh mount /dev/vdb1 /mnt/sysimage
- Chroot into the Installed System:
- Change the root environment to the mounted system:
sh chroot /mnt/sysimage
- Make Necessary Changes:
- You can now perform any necessary operations, such as editing configuration files, updating the system, or troubleshooting issues.
- Exit the Chroot Environment:
- After making the necessary changes, exit the chroot environment:
sh exit
- Unmount the Filesystem:
- Unmount the filesystem:
sh umount /mnt/sysimage
- Reboot the System:
- Reboot the system to apply changes:
sh reboot
Disabling All iptables Rules
If you need to disable all iptables rules as part of your troubleshooting, follow these steps within the chroot environment or after booting normally:
- Flush All Rules:
iptables -F
iptables -t nat -F
iptables -t mangle -F
iptables -t raw -F
- Delete All Chains:
iptables -X
iptables -t nat -X
iptables -t mangle -X
iptables -t raw -X
- Set Default Policies to ACCEPT:
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
- Save the Changes:
service iptables save
Restoring from Backup
If you have a known good backup and the approximate date when the system was stable, restoring from that backup can be a viable solution:
- Identify the Backup:
- Locate the backup file corresponding to the last known good state. or open a ticket with support stating from which day to restore.
- Restore the Backup:
- Use your backup software or tools to restore the system from the identified backup. This may involve copying files, using backup software, or other restoration processes specific to your backup system.
Reinstallation Option
If the system is too modified and cannot be recovered, consider reinstalling CentOS via the administration interface