🐛 Strange bug with pasting sudo password via SSH on Linux 🐧 #18594

Open
opened 2026-01-31 06:18:42 +00:00 by claunia · 0 comments
Owner

Originally created by @KMatuszak on GitHub (Oct 3, 2022).

Originally assigned to: @zadjii-msft on GitHub.

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

  1. Connect to an Ubuntu server with password set to HtJy*&fPMS4@K84C$RJfFT9*$#SR4E52 via SSH using Windows Terminal
  2. Authenticate using your username and password by pasting the password, this will work fine
  3. Try to run any sudo command which will ask for your sudo password, for example: sudo apt update && sudo apt upgrade -y
  4. Paste your sudo password either by CTRL+V or CTRL+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.

Originally created by @KMatuszak on GitHub (Oct 3, 2022). Originally assigned to: @zadjii-msft on GitHub. ### Windows Terminal version 1.15.2713.0 ### Windows build number 10.0.22621.608 ### Other Software ```bash 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 1. Connect to an Ubuntu server with password set to `HtJy*&fPMS4@K84C$RJfFT9*$#SR4E52` via SSH using Windows Terminal 2. Authenticate using your username and password by pasting the password, this will work fine 3. Try to run any sudo command which will ask for your sudo password, for example: `sudo apt update && sudo apt upgrade -y` 4. Paste your sudo password either by `CTRL+V` or `CTRL+SHIFT+V` ### Expected Behavior Password should be accepted, but it is not: ```bash 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.
claunia added the Issue-BugArea-InputNeeds-Tag-FixProduct-TerminalPriority-2 labels 2026-01-31 06:18:43 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#18594