#ssh 远程机器配置 Host tx HostName xxx.xxx.xxx.xxx User root Port 22 IdentityFile ~/.ssh/id_rsa # 公钥默认文件名就是这个,IdentityFile 配置可以省略,如果文件是别的名称就指定下
但是有个问题就是,登录的时候总要要等个 20 来秒才连接上,这是什么原因呢
使用 ssh -v tx 可以看登录的日志
1 2 3 4 5 6 7 8 9 10 11 12 13
debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password debug1: Next authentication method: gssapi-with-mic debug1: Unspecified GSS failure. Minor code may provide more information No Kerberos credentials available (default cache: FILE:/tmp/krb5cc_1000)
debug1: Unspecified GSS failure. Minor code may provide more information No Kerberos credentials available (default cache: FILE:/tmp/krb5cc_1000)
PreferredAuthentications Specifies the order in which the client should try authentication methods. This allows a client to prefer one method (e.g. keyboard-interactive) over another method (e.g. password). The default is: