大网数据广告活动
服务器运维问答

ssh on cygwin (win10): read_passphrase: can't open /dev/tty:

· 52CE 我爱测

Executing ssh on cygwin under windows 10 recently started failing, after many years of stable logins. The relevant output from ssh under a mintty from Xwindows: % ssh -tt -vvv <user@host> debug3: Failed to open file:C:\\ProgramDa…

问题原文

原帖链接 · JP Mattia · CC BY-SA 4.0

Executing ssh on cygwin under windows 10 recently started failing, after many years of stable logins. The relevant output from ssh under a mintty from Xwindows:

%  ssh -tt -vvv <user@host>
debug3: Failed to open file:C:\\ProgramData\\ssh/ssh_known_hosts error:2
debug3: Failed to open file:C:\\ProgramData\\ssh/ssh_known_hosts2 error:2
debug3: failed to open file:/dev/tty error:3
debug1: read_passphrase: can't open /dev/tty: No such file or directory
debug3: spawning /usr/X11R6/bin/ssh-askpass
CreateProcessW failed error:2
ssh_askpass: posix_spawn: No such file or directory
Host key verification failed.

The special file /dev/tty is there:

% ls -la /dev/tty
crw-rw-rw- 1 jpmattia None 5, 0 May 22 15:04 /dev/tty

I updated Cygwin to make sure all the binaries were the latest. Also windows updated itself earlier this week.

I'm a little baffled as to what might be going on. Clues gratefully accepted.

已采纳解答

原帖链接 · JP Mattia · CC BY-SA 4.0

Documenting my solution in case anyone else has the problem: It appears that a Windows version of OpenSSH was introduced in the 2018 spring update, and it is being called instead of Cygwin's ssh. (See e.g. https://www.zdnet.com/article/openssh-arrives-in-windows-10-spring-update/)

% which ssh
/cygdrive/c/WINDOWS/System32/OpenSSH/ssh

The reason for the sudden problem with ssh is that the cygwin PATH has /cygdrive/c/WINDOWS/System32 ahead of /usr/bin/. Or at least, mine did.

So the issue is solved by calling /usr/bin/ssh explicitly. (Reordering the PATH is also a possible solution, but not for my environment.)

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-05-22)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。