Start SSH in CentOS rescue mode
11,440
I tried to do same thing with CentOS 7.2 to save some files. I booted into rescue mode after inserting the DVD and open the shell.
First I configure network with nmtui
than I started ssh service without getting #bash
:
#sh-4.2:service sshd start
and it started. But couldn't reach my files from shell and I get bash
#sh-4.2:chroot /mnt/sysimage
#bash:cd 'myfiles'
#bash:scp /* user@IPADDRESS:/path
This worked just fine. I tried to start ssh service and it didn't work. Do it with shell.
Related videos on Youtube
Author by
John Edgar
Updated on September 18, 2022Comments
-
John Edgar over 1 year
I am booted into rescue mode after inserting the DVD. OS is CentOS 6.7 64
I've tried
cd /mnt/sysimage chroot /mnt/sysimage service sshd restart
which gave back
service command not found
.What do I do next?
-
Eric Renouf over 8 yearsWhy are you trying to do this? Could you just run
/usr/sbin/sshd
without the service trappings? -
John Edgar over 8 yearsYes network is setup and pinging. There is no /usr/sbin/sshd
-
Eric Renouf over 8 yearsThat also isn't in the chroot under
/mnt/sysimage
? -
John Edgar over 8 yearsCorrect (chara limit)
-
Eric Renouf over 8 yearsIs that perhaps part of why you're in rescue mode? Has something bad happened to the disk so it lost
/usr/sbin
and other stuff? -
John Edgar over 8 yearsI'm not too sure, it's been hacked for sure but I don't know what they have done. Booting gives "PCI: Fatal: No config space access function found". Rescue mode should be able to start SSH though? or FTP, anything to get access.
-
Eric Renouf over 8 yearsLet us continue this discussion in chat.
-
Oldskool over 8 yearsWhy would you want to start SSHD in rescue mode of a machine that you know is hacked? I would copy the important files onto an USB drive, but definitely not make a compromised machine able to communicate over any network, internally or externally.
-
Andrey Kitsa over 7 yearsblogs.reliablepenguin.com/2009/07/07/… You missed
mount /dev/pts
I am sure if you have correct ISO and linux on local disk FS it will work now.
-