添加ssh key时出错:
$ ssh-add ~/.ssh/id_rsa
Could not open a connection to your authentication agent.解决:
$ eval `ssh-agent -s`
$ ssh-add ~/.ssh/id_rsa添加ssh key时出错:
$ ssh-add ~/.ssh/id_rsa
Could not open a connection to your authentication agent.解决:
$ eval `ssh-agent -s`
$ ssh-add ~/.ssh/id_rsaCould not open a connection to your authentication agent
ssh连接另外一台主机,提示以下错误$ ssh serverusername@xxx.xxx.xxx
Received disconnect from xxx.xxx.xxx.xxx port 22:2: Too many authentication failures for user
Disconnected from xxx.xxx.xxx.xxx port 22
-v选项来查看ssh登录时的详细输出信息:$ ssh -v serverusername@xxx.xxx.xxx.xxx
...
debug1: Authenticating to xxx.xxx.xxx.xxx:22 as 'serverusername'
...
debug1: Found key in /Users/username/.ssh/known_hosts:16
....
debug1: Offering public key: RSA SHA256:xxx /Users/username/.ssh/a_id_rsa
...
debug1: Offering public key: RSA SHA256:xxx /Users/username/.ssh/b_id_rsa
...
debug1: Offering public key: RSA SHA256:xxx /Users/username/.ssh/id_rsa
...
debug1: Trying private key: /Users/username/.ssh/id_dsa
debug1: Offering public key: ECDSA SHA256:xxx /Users/username/.ssh/id_ecdsa
Received disconnect from xxx.xxx.xxx.xxx port 22:2: Too many authentication failures
Disconnected from xxx.xxx.xxx.xxx port 22
ssh key导致的问题。ssh连接服务器时,会自动用本地~/.ssh目录下的ssh key文件进行登录授权校验。服务端在收到客户端过多的ssh key校验请求时,就会拒绝客户端的连接,并报错:Too many authentication failuresssh key文件ssh key文件,需要排除不相干的ssh key文件的干扰。ssh key文件:$ ssh -i some_id_rsa -o 'IdentitieseOnly yes' serverusername@xxx.xxx.xxx
$ ssh -i some_id_rsa -o IdentitiesOnly=yes serverusername@xxx.xxx.xxx
ssh配置文件~/.ssh/config中针对服务器地址进行配置。如果文件不存在,创建空配置文件。Host xxx.xxx.xxx.xxx
IdentityFile ~/.ssh/key_for_somehost_rsa
IdentitiesOnly yes
Port 22
ssh key来进行登录校验$ ssh -o 'PubkeyAuthentication no' serverusername@xxx.xxx.xxx
$ ssh -o PubkeyAuthentication=no serverusername@xxx.xxx.xxx
Host xxx.xxx.xxx.xxx
PubkeyAuthentication no
Port 22
Log等级 Android log 等级在 android/log.h 中定义如下: typedef enum android_LogPriority { /** For internal use only. */ ANDROID_LOG_UNKNOWN =...