One minute I could sudo vi a file and then after several minutes I could not sudo vi at all. It would not accept my user passwd.
I use ssh-keys with no passwd to get into my VPS. I could go to my console at OVHCloud and had no problem with my passwd. The issue turned out to be a glitch caused by my GitBash terminal I use on my Windows 11 machine. It was sending ANSI CSI escape sequences rather than raw characters. Since I still want to use Git Bash for other reasons the permanent solution was to change my ssh config file to this:
Host your-vps-ip-or-hostname
HostName your-vps-ip
User yourusername
IdentityFile ~/.ssh/your-key
SendEnv TERM
SetEnv TERM=xterm