How to Enable SSH Service in Rescue Mode on CentOS/RockyLinux/AlmaLinux

  1. boot from iso
  2. On the very first screen, you will find an option like the below image, so simply select "Troubleshooting" and press enter.
  3. Enable the SSH service by replacing the content of /etc/ssh/sshd_config with /etc/ssh/sshd_config.anaconda
    cp /etc/ssh/sshd_config.anaconda /etc/ssh/sshd_config
  4. Add temporary IP
    ip addr add [ip_address] dev [interface]
  5. Start the service
    servicectl start ssh