How to enable SSH Service and configure network in the rescue mode?
Environment
- Red Hat Enterprise Linux 7
- Red Hat Enterprise Linux 8
- Red Hat Enterprise Linux 9
- Red Hat Enterprise Linux 10
Issue
- How to enable SSH Service when the system is in Rescue mode?
- How to enable SSH Service when booting with ISO in rescue mode?
Resolution
-
Get to the Rescue Mode shell:
In RHEL 7 sh-4.2# In RHEL 8 sh-4.4# In RHEL 9 bash-5.1# In RHEL 10 bash-5.2# -
Enable the network in rescue mode outside the
chrootenvironment -
Configuring and Starting
sshdservice-
Locate the
ssh_config file# find / -name "*sshd_config*" /etc/ssh/sshd_config.anaconda -
Create a new
sshd_configfile.# cp /etc/ssh/sshd_config.anaconda /etc/ssh/sshd_config -
Start the SSH daemon:
# systemctl start sshd
-
-
Alternate Method.
-
While booting system into the rescue mode using ISO, Press
TABunderRescue a Red Hat Enterprise Linux System, appendsshd=1(For RHEL 8 and below) orinst.sshd=1(For RHEL 9 and above) and pressenterkey. -
Enable the network in rescue mode outside the
chrootenvironment
-
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.