Site icon moneyslow.com

Permissions 0644 for '*.pem' are too open 和 sign_and_send_pubkey: no mutual signature supported解决办法

mac操作技巧

mac操作技巧

ssh -i key 执行时 Permissions 0644 for '*.pem' are too open 问题
ssh -i key 地址 ;使用密钥登录时的 

Permissions 0644 for '你的.pem' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "你的.pem": bad permissions
li@login.bcom: Permission denied (publickey,gssapi-keyex,gssapi-with-mic). 

解决办法
chmod 600 你的密钥文件  
比如:  chmod 600 money.pem


新的OpenSSH版本(7.0+)不推荐使用DSA密钥,默认情况下不使用DSA密钥(不在服务器或客户端上)。这些密钥不再被使用,因此如果可以,我建议尽可能使用RSA密钥。
如果确实需要使用DSA密钥,则需要在客户端配置中使用
PubKeyAcceptedKeyTypes+ssh-dss
应该将该行放入~/.ssh/config中
根据提示我们进入当前用户的根目录。

localhost:.ssh money$ cd ~/.ssh/
localhost:.ssh money$ vim config
编辑创建一个文件,名字为config

增加以下一句话:
Host *
PubkeyAcceptedKeyTypes=+ssh-dss
保存退出,设置权限为600

localhost:.ssh money$ chmod 600 config #权限太高了可是无法执行的
现在再使用上边的语句进行登录

localhost:.ssh money$ ssh -i /Users/money/.ssh/siyao 用户名@IP -p 端口
Last login: Fri Apr 12 10:23:28 2019 from xxx.xxx.xxx.xxx

Welcome to Alibaba Cloud Elastic Compute Service !
Enter your Verifycode or exit:

Exit mobile version