To exit vi or vim without saving changes, press Esc a few times to enter Command mode, then type :q! and hit Enter. To exit vi or vim and commit your changes, press the Escape key to ensure you're in ...
You've been typing the wrong commands for years. Linux moved on, and nobody bothered to tell you.
Stuck SSH session? Press Enter, type ~. to close frozen SSH instantly. Learn all SSH escape sequences most users never discover.