ssh免密失效的问题

当前解决:恢复权限

 


7.ssh免密登录
ssh-keygen -t rsa
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys


ssh hyt-bigdata02

ssh-copy-id 10.214.22.46 
ssh-copy-id 10.214.22.47 
ssh-copy-id 10.214.22.48 
ssh-copy-id 10.214.22.49 
ssh-copy-id 10.214.22.50 


ssh-copy-id hyt-bigdata01 
ssh-copy-id hyt-bigdata02 
ssh-copy-id hyt-bigdata03 
ssh-copy-id hyt-bigdata04 
ssh-copy-id hyt-bigdata05 


Spcntest&0920

ssh-copy-id -i ~/.ssh/id_rsa.pub root@10.214.22.46 

更改权限:

-rw-------  1 root root 1200 11月  6 17:23 authorized_keys
-rwxrwxrwx. 1 root root 1679 11月  6 17:21 id_rsa
-rwxrwxrwx. 1 root root  400 11月  6 17:21 id_rsa.pub
-rwxrwxrwx. 1 root root 1745 11月  6 17:24 known_hosts

01可用的权限:
-rw------- 1 root root  400 11月  6 23:53 authorized_keys    600
-rw------- 1 root root 1679 11月  6 23:42 id_rsa             600
-rw-r--r-- 1 root root  400 11月  6 23:42 id_rsa.pub         644
-rw-r--r-- 1 root root  376 11月  6 18:12 known_hosts        644


03可用的权限
-rw------- 1 root root  400 11月  6 23:43 authorized_keys
-rw------- 1 root root 1679 11月  6 18:09 id_rsa
-rw-r--r-- 1 root root  400 11月  6 18:09 id_rsa.pub
-rw-r--r-- 1 root root  376 11月  6 18:18 known_hosts


02操作:
chmod 600 /root/.ssh/authorized_keys
chmod 600 /root/.ssh/id_rsa
chmod 644 /root/.ssh/id_rsa.pub
chmod 644 /root/.ssh/known_hosts


-rw-------  1 root root 1200 11月  6 17:23 authorized_keys
-rw-------. 1 root root 1679 11月  6 17:21 id_rsa
-rw-r--r-- 1 root root  400 11月  6 17:21 id_rsa.pub
-rw-r--r--. 1 root root 1745 11月  6 17:24 known_hosts

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值