New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ssh-keygen.exe hangs for end user #836
Comments
Problem solved. Since nobody chimed in, I guess you already know the solution, so I will not share it. |
We haven't seen this problem yet. It helps the rest of us if you can share how you solved it. |
The command "ssh-keygen.exe -t ed25519 -o -a 100 -f ${HOME}/.ssh/id_ed25519" should interact with the user, asking for a password to protect the private key soon to be generated. In the case of Win32-OpenSSH, however, the interaction fails: the command does not terminate, and you must interrupt it manually. The trick to bypass the interaction is to provide the password directly in the command, as in "ssh-keygen.exe -t ed25519 -o -a 100 -f ${HOME}/.ssh/id_ed25519 -P your-password-here". |
Not sure why the ssh-keygen hangs for you but it works on my machine (windows 10), PS E:> .\ssh-keygen.exe -t ed25519 -o -a 100 -f e:\id_ed25519 |
Closing this thread as we couldn't reproduce on multiple machines.. |
Having just encountered this issue myself (and resolved it), I believe the problem results when you try to run ssh-keygen in cygwin. It runs normally through cmd.exe, but hangs as described when run in the cygwin shell. |
I'm having this issue as well and for me it's specifically occurring when creating a new key by running ssh-keygen within a PowerShell script file using the PowerShell ISE without passing a passphrase parameter into the call. Repro: Results in the script hanging with no output in the integrated PowerShell window. |
I'm using powershell 7.2 and can confirm this. It hangs on Edit: Closed powershell and tried on CMD. It works fine. Then tried on Powershell again. It worked. WHAT ? |
Just a quick note since I hit a related problem and found this issue. ssh-keygen can prompt for input in several situations. As noted above you can hit this when it wants a password. In my case I hit a problem when the output file specified to -f already existed. In this case it prompts to check if you want to overwrite the file. This can cause a script to hang if there's no input for ssh-keygen to read. Because in the test environment sometimes the file was already there and sometimes it wasn't, this was a bit mystifying to debug. |
I just ran into the same problem in git bash. Same solution of pre-specifying both password and file name. |
I just experienced this bug this morning with Windows 11 Pro. ssh-keygen froze at the input-filename prompt under PowerShell (my default shell on Windows). ssh-keygen succeeded under cmd.exe (not my default shell). |
May it also depend on terminal? In my case, it always gets stuck in Windows Terminal, but works fine in the default |
For me it stuck in Windows Terminal, but only if I added the -G parameter. I ended up in using the default filename and renaming later. |
This happens to me too, on Windows 11 v10.0.22000.1098 with PowerShell 7.2.6. |
Same issue windows 10 powershell |
Please answer the following
If it is a terminal issue then please go through wiki
https://github.com/PowerShell/Win32-OpenSSH/wiki/TTY-PTY-support-in-Windows-OpenSSH
"OpenSSH for Windows" version
((Get-Item (Get-Command sshd).Source).VersionInfo.FileVersion)
latest
Server OperatingSystem
((Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows nt\CurrentVersion\" -Name ProductName).ProductName)
Windows 10 Pro
Client OperatingSystem
Windows 10 Pro
What is failing
ssh-keygen.exe -t ed25519 -o -a 100 -f ${HOME}/.ssh/id_ed25519
Expected output
success
Actual output
The command does not terminate.
No output produced at all.
The text was updated successfully, but these errors were encountered: