Special Characters Dropped Pasting into Debian SSH sudo password prompt #18697

Closed
opened 2026-01-31 06:21:40 +00:00 by claunia · 12 comments
Owner

Originally created by @markolbert on GitHub (Oct 15, 2022).

Windows Terminal version

1.15.2713.0

Windows build number

10.0.22621.0

Other Software

accessing remote Debian 10 system via ssh

Steps to reproduce

  1. Copy password containing a colon (:) character to clipboard
  2. Paste password in response to sudo request for password
  3. Fail

This issue suddenly appeared today for me. It definitely wasn't there even a couple of weeks ago (during which interval I installed Windows 11 2022 H2 and some other subsequent Windows update).

I've confirmed that normal cut and paste -- even into the Debian command line within the ssh shell -- works correctly. In other words, pasting the password, as clear text, to the Debian command prompt displays the correct text. But the sudo password interface rejects whatever it's getting.

Granted, this could be a problem with sudo or ssh. But I haven't updated them recently, so I doubt it. And it was working perfectly fine up until now.

Expected Behavior

The password should be accepted

Actual Behavior

the password gets rejected

Originally created by @markolbert on GitHub (Oct 15, 2022). ### Windows Terminal version 1.15.2713.0 ### Windows build number 10.0.22621.0 ### Other Software accessing remote Debian 10 system via ssh ### Steps to reproduce 1) Copy password containing a colon (:) character to clipboard 2) Paste password in response to sudo request for password 3) Fail This issue suddenly appeared today for me. It definitely wasn't there even a couple of weeks ago (during which interval I installed Windows 11 2022 H2 and some other subsequent Windows update). I've confirmed that normal cut and paste -- even into the Debian command line within the ssh shell -- works correctly. In other words, pasting the password, as clear text, to the Debian command prompt displays the correct text. But the sudo password interface rejects whatever it's getting. Granted, this could be a problem with sudo or ssh. But I haven't updated them recently, so I doubt it. And it was working perfectly fine up until now. ### Expected Behavior The password should be accepted ### Actual Behavior the password gets rejected
claunia added the Needs-TriageIssue-BugNeeds-Author-Feedback labels 2026-01-31 06:21:40 +00:00
Author
Owner

@j4james commented on GitHub (Oct 16, 2022):

Do you have a reason to believe that the : in the password is a factor, or was that just a guess? Because this sounds like it might be the result of bracketed paste mode being enabled, as described in https://github.com/microsoft/terminal/issues/14129#issuecomment-1275013651.

@j4james commented on GitHub (Oct 16, 2022): Do you have a reason to believe that the `:` in the password is a factor, or was that just a guess? Because this sounds like it might be the result of bracketed paste mode being enabled, as described in https://github.com/microsoft/terminal/issues/14129#issuecomment-1275013651.
Author
Owner

@markolbert commented on GitHub (Oct 16, 2022):

Thanx @j4james for the quick reply. You're right, it's just a guess. I appreciate the reference, though, because it gives me something to consider.

But here's a weird thing: I tried running sudo showkeys -a on the ssh terminal, as was suggested in the link you provided. Everything worked correctly...which prompted me to close the shell and try again. Which then failed as it had the other day.

Re-opening the shell a third time resulted in normal behavior.

So now I seem to be having some kind of "random" behavior (I put that in quotes because while I tried to open the shell each time the exact same way maybe I did).

Weird.

@markolbert commented on GitHub (Oct 16, 2022): Thanx @j4james for the quick reply. You're right, it's just a guess. I appreciate the reference, though, because it gives me something to consider. But here's a weird thing: I tried running `sudo showkeys -a` on the ssh terminal, as was suggested in the link you provided. Everything worked correctly...which prompted me to close the shell and try again. Which then failed as it had the other day. Re-opening the shell a third time resulted in normal behavior. So now I seem to be having some kind of "random" behavior (I put that in quotes because while I tried to open the shell each time the exact same way maybe I did). Weird.
Author
Owner

@zadjii-msft commented on GitHub (Oct 21, 2022):

Are you using a shell to launch ssh? (if so, which one?) Or, are you launching ssh.exe directly as your profile's commandline? What version of ssh are you using/?

@zadjii-msft commented on GitHub (Oct 21, 2022): Are you using a shell to launch ssh? (if so, which one?) Or, are you launching `ssh.exe` directly as your profile's `commandline`? What version of `ssh` are you using/?
Author
Owner

@markolbert commented on GitHub (Oct 21, 2022):

@zadjii-msft, this is all taking place inside Windows Terminal. I don't know offhand what version of ssh it uses. I presume it's whatever the latest one from Microsoft as I've never installed another ssh client. And, yes, the remote terminal window is opened via ssh directly (as defined in the json config file).

@markolbert commented on GitHub (Oct 21, 2022): @zadjii-msft, this is all taking place inside Windows Terminal. I don't know offhand what version of ssh it uses. I presume it's whatever the latest one from Microsoft as I've never installed another ssh client. And, yes, the remote terminal window is opened via ssh directly (as defined in the json config file).
Author
Owner

@zadjii-msft commented on GitHub (Oct 25, 2022):

@markolbert We can probably quickly rule out if this is a dupe of #14129 with the following:

After connecting to the remote machine, (and pasting isn't working), try manually disabling bracketed paste mode by executing printf "\e[?2004l". (This assumes there isn't something in your shell that is constantly re-enabling that mode.)

If pasting the password works again, then we can just call this the same root cause.

@zadjii-msft commented on GitHub (Oct 25, 2022): @markolbert We can probably quickly rule out if this is a dupe of #14129 with the following: After connecting to the remote machine, (and pasting isn't working), try manually disabling bracketed paste mode by executing `printf "\e[?2004l"`. (This assumes there isn't something in your shell that is constantly re-enabling that mode.) If pasting the password works again, then we can just call this the same root cause.
Author
Owner

@markolbert commented on GitHub (Oct 26, 2022):

Thanx @zadjii-msft, I'll definitely do that. Sadly, the problem is intermittent -- it only strikes about one in four accesses via Terminal and ssh, so it may be a while before I can report anything.

@markolbert commented on GitHub (Oct 26, 2022): Thanx @zadjii-msft, I'll definitely do that. Sadly, the problem is intermittent -- it only strikes about one in four accesses via Terminal and ssh, so it may be a while before I can report anything.
Author
Owner

@ghost commented on GitHub (Oct 30, 2022):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@ghost commented on GitHub (Oct 30, 2022): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Author
Owner

@markolbert commented on GitHub (Oct 30, 2022):

Kind of a little weird to close an intermittent problem due to a relatively short passage of time but whatever. If Microsoft doesn't care about solving these kinds of problems I guess there's little I can do about it. Except switch to a Mac :)

@markolbert commented on GitHub (Oct 30, 2022): Kind of a little weird to close an intermittent problem due to a relatively short passage of time but whatever. If Microsoft doesn't care about solving these kinds of problems I guess there's little I can do about it. Except switch to a Mac :)
Author
Owner

@zadjii-msft commented on GitHub (Oct 31, 2022):

As a general policy, for stuff like this with a single poster with an issue we can't repro, we tend to have the bot bump things along. This prevents the backlog from filled with people who fixed the issue on their own, or can't be bothered to follow up on the investigation. This keeps the backlog much more managable and ensures that we can actually follow up on bug reports.

We're pretty sure about the root cause here, just waiting for you to validate our guess here. I'm gonna leave this as tagged "need-author-feedback". If the bot does come through and close this before you can repro it again, and then you do repro this and it wasn't the root cause we assumed, then we can always reopen this thread.

@zadjii-msft commented on GitHub (Oct 31, 2022): As a general policy, for stuff like this with a single poster with an issue we can't repro, we tend to have the bot bump things along. This prevents the backlog from filled with people who fixed the issue on their own, or can't be bothered to follow up on the investigation. This keeps the backlog much more managable and ensures that we can actually follow up on bug reports. We're pretty sure about the root cause here, just waiting for you to validate our guess here. I'm gonna leave this as tagged "need-author-feedback". If the bot does come through and close this before you can repro it again, and then you do repro this and it _wasn't_ the root cause we assumed, then we can _always_ reopen this thread.
Author
Owner

@markolbert commented on GitHub (Oct 31, 2022):

Good point, thanx for the clarification. I could always open a new issue and point it at this one, too, I guess.

@markolbert commented on GitHub (Oct 31, 2022): Good point, thanx for the clarification. I could always open a new issue and point it at this one, too, I guess.
Author
Owner

@ghost commented on GitHub (Nov 6, 2022):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@ghost commented on GitHub (Nov 6, 2022): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Author
Owner

@Rayhubi commented on GitHub (Nov 9, 2022):

Thanks

@Rayhubi commented on GitHub (Nov 9, 2022): Thanks
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#18697