有时我需要ssh到一个新的远程服务器,并立即修复一些没有ssh试图find我的主机上的任何私钥。 它通常在这个时候停顿:
debug1: Next authentication method: gssapi-with-mic debug1: Unspecified GSS failure. Minor code may provide more information Credentials cache file '/tmp/blah' not found debug1: Unspecified GSS failure. Minor code may provide more information Credentials cache file '/tmp/blah2' not found debug1: Unspecified GSS failure. Minor code may provide more information
有没有一种方法可以指定ssh只是立即进行基于密码的身份validation?
ssh -o PreferredAuthentications=password,keyboard-interactive,gssapi-with-mic,hostbased,publickey [email protected]
如果您不希望允许密码访问的任何服务器的密钥访问,也可以将此设置放入~/.ssh/config 。
它试图find您的计算机上的私钥; 远程计算机将拥有公钥。 远程计算机不应该有你的私钥(除非它是你的控制下的计算机)。
看起来你已经开启了GSS Auth,从命令行你可以用ssh -o GSSAPIAuthentication=no [email protected]来closures它。
如果这样的话,通过在~/.ssh/config文件(或系统范围的ssh_config文件)的Host *部分中添加GSSAPIAuthentication no ,可能会更容易closures默认连接。 如果您需要本地服务器,则可以添加一个Host *.my_company.com部分,并重新打开它。
如果使用类似命令连接到服务器
那么你所看到的问题很可能是由于客户端无法parsing服务器的主机名造成的。 一旦客户端可以parsing服务器的主机名,您仍然会收到错误消息,但没有由名称服务超时造成的延迟。