terminal: 🐛 Strange bug with pasting sudo password via SSH on Linux 🐧
Windows Terminal version
1.15.2713.0
Windows build number
10.0.22621.608
Other Software
kmatuszak@ubuntu:~$ bash --version
GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu)
kmatuszak@ubuntu:~$ sudo -V
Sudo version 1.8.31
Sudoers policy plugin version 1.8.31
Sudoers file grammar version 46
Sudoers I/O plugin version 1.8.31
kmatuszak@ubuntu:~$ ssh -V
OpenSSH_8.2p1 Ubuntu-4ubuntu0.5, OpenSSL 1.1.1f 31 Mar 2020
kmatuszak@ubuntu:~$ uname -r
5.15.0-48-generic
kmatuszak@ubuntu:~$ lsb_release -sd
Ubuntu 20.04.5 LTS
Steps to reproduce
- Connect to an Ubuntu server with password set to
HtJy*&fPMS4@K84C$RJfFT9*$#SR4E52via SSH using Windows Terminal - Authenticate using your username and password by pasting the password, this will work fine
- Try to run any sudo command which will ask for your sudo password, for example:
sudo apt update && sudo apt upgrade -y - Paste your sudo password either by
CTRL+VorCTRL+SHIFT+V
Expected Behavior
Password should be accepted, but it is not:
kmatuszak@ubuntu:~$ sudo apt update && sudo apt upgrade -y
[sudo] password for kmatuszak:
Sorry, try again.
[sudo] password for kmatuszak:
Actual Behavior
Password is not accepted either if pasted by CTRL+V or CTRL+SHIFT+V, but it works fine when typed by hand. Also password is accepted just fine if pasted in PuTTY. Other passwords also work just fine if pasted in Windows Terminal. The same password works just fine for initial authentication when connecting to an SSH server, but not for authenticating when running sudo.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 25 (9 by maintainers)
Commits related to this issue
- Initialize all members of Terminal (#14345) The following members were not initialized during construction: * `CursorType _defaultCursorShape` * `bool _suppressApplicationTitle` * `bool _bracketed... — committed to microsoft/terminal by lhecker 2 years ago
- Re-enable AuditMode for TerminalCore (#14344) AuditMode was accidentally disabled in 1c6aa4d, around 2 years ago. This should fix this issue and address all the warnings it now generates. Related... — committed to microsoft/terminal by lhecker 2 years ago
- Initialize all members of Terminal (#14345) The following members were not initialized during construction: * `CursorType _defaultCursorShape` * `bool _suppressApplicationTitle` * `bool _bracketedPas... — committed to microsoft/terminal by lhecker 2 years ago
- Initialize all members of Terminal (#14345) The following members were not initialized during construction: * `CursorType _defaultCursorShape` * `bool _suppressApplicationTitle` * `bool _bracketedPas... — committed to microsoft/terminal by lhecker 2 years ago
@j4james
Thanks, it seem to work on my side, I tried the bind method for the current session and it didn’t work. (
bind 'set enable-bracketed-paste off')But adding this
set enable-bracketed-paste offto my$HOME/.inputrcand then closing and re-opening a new terminal worked… 👍👍This should have been fixed by #14345, no?
Disabling bracketed paste does solve the issue, at least for the current ssh session. I wonder why I never had this problem before with Windows Terminal.