[db] updates ssh script to be more robust, I think?