SSH Remote Access - Testing
Hi guys, how do you revert settings for SSHD on remote VMs? in order not to be locked out if something goes wrong.
- sshd -T >> will check if config is ok or not, before exiting the VM. Is there a way to revert the original settings after a certain time? just as a back up, if really some unforeseen circumstances that will pop-up and not able to SSH Thanks. |
One way is to fire up a parallel instance of the SSH daemon on a second port, but otherwise using all the same settings. You'd obviously need some other port open at least temporarily or use a bastion or jump host:
Code:
sudo /usr/sbin/sshd -p 2222 Another way is to save the working configuration and set an at job to restore it + reload it in the daemon after a number of minutes. That way, if you can get back in you can cancel the at job but if you can't get back in, if you set up the job correctly, you can get back in. That can certainly be used with firewall / packet filter settings, too. I'd go with the -p option myself. |
you can set a crontab or something similar to overwrite the config and restart sshd if you wish.
|
All times are GMT -5. The time now is 03:14 PM. |