SSH: Undo Your Network Screwups After You've Lost the Connection
Messing
with a firewall or a network over a remote connection? Nerve wracking
isn't it? Change the wrong setting and you'll be locked out, unable to
fix it.
So why not undo your mistake? Schedule a job to run at a later time that undoes what you're about to do.
at now + 5 minutes <<< 'cp /etc/ssh/sshd_config.old /etc/ssh/sshd_config; service sshd restart'
If you screw up, the job will run and restore things to the way they were. If you your change works, then just run
atq
to check the queue of upcoming at jobs, and
atrm jobNumber
to remove it.
Λάβετε μέρος στη συνομιλία