SSH登陆错误:“warning:unprotected private key file” 问题

故障现象:

[root@localhost .ssh]# ssh heat-admin@192.168.100.100

The authenticity of host '192.168.100.100 (192.168.100.100)' can't be established.

ECDSA key fingerprint is fb:db:01:40:52:4c:da:9d:56:43:52:a5:c0:27:5e:d2.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added '192.168.100.100' (ECDSA) to the list of known hosts.

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

@ WARNING: UNPROTECTED PRIVATE KEY FILE! @

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

Permissions 0644 for '/root/.ssh/id_rsa' are too open.

It is required that your private key files are NOT accessible by others.

This private key will be ignored.

bad permissions: ignore key: /root/.ssh/id_rsa

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

处理过程:

[root@localhost .ssh]# chmod 700 /root/.ssh/id_rsa

[root@localhost .ssh]# ssh heat-admin@192.168.100.100

Last login: Wed Feb 22 06:45:48 2017 from 192.168.100.205

解决方法:

这里是说密钥文件权限不能为0644,0644权限太开放了,要求你的密钥文件不能被其它用户读取。所以我们现在需要修改一下密钥文件权限。在命令行输入chmod 700 /root/.ssh/id_rsa即可。这里“/root/.ssh/id_rsa”就是warning里给出的密钥文件名,所以你需要换成你的warning信息里给出的秘钥文件名。

格式如下:chmod 权限码 密钥文件名

转载于:https://my.oschina.net/whoareyou/blog/850465

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值