连接ssh出现Permission denied之一解

问题描述:

在一台centos 6.0的vps上使用ssh无论连接什么样的主机都连接不上,提示信息为:

Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).

排除了防火墙等原因,百思不得其解。后来在man ssh里面发现了一个参数-v

     -v      Verbose mode.  Causes ssh to print debugging messages about its
             progress.  This is helpful in debugging connection, authentica‐
             tion, and configuration problems.  Multiple -v options increase
             the verbosity.  The maximum is 3.

于是使用ssh -v localhost试图连接。在debug信息里面发现一条很奇怪的信息,如下:

debug1: Next authentication method: password
debug1: read_passphrase: can't open /dev/tty: No such file or directory

尝试使用password模式时,没办法调用read_passphrase来获取密码。提示/dev/tty这个文件缺失。

于是在本地的cygwin(我是win环境)下用ls -l /dev/tty得到以下信息:

crw-rw-rw- 1 oott123 None 5, 0 十月  5 14:53 /dev/tty

使用mknod /dev/tty c 5 0来创建一个新的设备文件,故障解除。

后来##Orz的atmouse发现了这个页面,和我遇到的问题一模一样:【这里】,解决方式也是一样的。

评论

还没有评论。

发表评论

发表评论代表你授权本网站存储并在必要情况下使用你输入的邮箱地址、连接本站服务器使用的 IP 地址和用户代理字符串 (User Agent) 用于发送评论回复邮件,以及将上述信息分享给 Libravatar Akismet,用于显示头像和反垃圾。