简体   繁体   中英

Recover 'sshd_config' file in CentOS server

I have a 10 node cluster. Out of which, I was working on of the node(which is not a master node). I was trying to configure IPython and had made some changes to sshd_config file. To make those changes come into effect, I ran this command:

sudo service sshd restart

From then,I was not able to login into that machine. I tried connecting from the other 9 nodes, but in vain. (I tried ssh user@IP )

I don't know what happened.

I have searched for recovering the file..but, all the solutions are when we are able to login. But here, we are not even able to login into machine..then how come I change anything....is there any way that I can do from the other 9 nodes.....something like...apply the same sshd_config of the remaining 9 nodes to the damaged node,please help..and BTW..the 10 node cluster is AWS EC2 instance.

It's possible that there is an error in the sshd_config file that prevents sshd from starting up successfully. Normally a sudo service sshd restart will check for errors before restarting (using sshd -t ), but it doesn't seem like that happened.

It sounds like you've lost your connection to this server, and since sshd now won't start up you're locked out.

If this EC2 instance is EBS-backed, you can fix this by mounting the root volume on another instance, editing the sshd_config file to fix the error, and restarting the original instance. The procedure described in this question is basically what you need to do.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM