Nope, won't work. Best bet: reboot your (remote?) machine into recovery mode if this is possible and modify the configuration then. And an advice for the future: keep an existing shell open and try to re-login with your existing account in a new session before terminating (no offense meant).