ssh 密钥文件权限设定

ssh 密钥文件权限设定,第1张

ssh通过密钥无密码访问服务器时,尽管密郑祥钥配好了,端口服务启动都正常,但是还是ssh还是不喊茄搏能访问。

最后发现,是密钥文纳培件的权限问题,

一般来说:

对.ssh目录设置700权限

对id_rsa,authorized_keys文件设置600权限

对id_rsa.pub,known_hosts文件设置644权限

所以,权限设置不对的话ssh登陆不上Linux系统

1、购买服务器

2、加入安全组

3、修改实例名称,修改亮早型实例密码

1 查看ssh配置

2 安装SSH

3 启动服务

4 查看ssh服务的状态

输入以下命令:

5 在电脑终端输入

1.添加文件

2.添加公钥到文件内(id_rsa.pub)

3.编辑ssh配置文件:

4.重启sshd服务

5 在电脑终端敬猜输入

常见错误:

IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!

Someone could be eavesdropping on you right now (man-in-the-middle attack)!

It is also possible that a host key has just been changed.

The fingerprint for the ECDSA key sent by the remote host is

SHA256:sbd8mG3CPJc81mLgPPwLwVy7LF8qvUUuXisbcPKzTyE.

Please contact your system administrator.

Add correct host key in /Users/admin/.ssh/known_hosts to get rid of this message.

Offending ECDSA key in /Users/admin/.ssh/known_hosts:12

ECDSA host key for 47.96.118.128 has changed and you have requested strict checking.

Host key verification failed.

解决睁手办法如下 输入

然后重新连接即可。


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/tougao/12291308.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-24
下一篇 2023-05-24

发表评论

登录后才能评论

评论列表(0条)

保存