Try @prognostikos' fixssh function.