ssh免密码登录的坑
来源:互联网 发布:c语言中bind函数 编辑:程序博客网 时间:2024/05/22 09:07
用ssh-keygen命令生成公钥后,会在~/.ssh下面生成2个文件:
[root@localhost .ssh]# ll
total 32
-rw------- 1 root root 1675 Aug 11 20:13 id_rsa
-rw-r--r-- 1 root root 408 Aug 11 20:13 id_rsa.pub
cat id_rsa.pub>>authorized_keys
登录仍然提示需要密码:
[root@localhost .ssh]# ssh localhost
The authenticity of host 'localhost (127.0.0.1)' can't be established.
RSA key fingerprint is 77:26:4d:84:86:73:f5:55:b0:91:e5:d7:28:db:71:18.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'localhost' (RSA) to the list of known hosts.
root@localhost's password:
重新给.ssh设置权限就好了。
1. chmod 700 ~/.ssh
2. chmod 0600 /root/.ssh/id_rsa
3.chmod 600 ~/.ssh/authorized_keys
[hdfs@localhost .ssh]$ ssh localhost
Last login: Fri Aug 11 20:15:15 2017 from localhost.localdomain
[hdfs@localhost ~]$
- ssh免密码登录的坑
- SSH免密码登录
- ssh 免密码登录
- ssh 免密码登录
- ssh 免密码登录
- ssh免密码登录
- ssh 免密码登录
- ssh 免密码登录
- ssh 免密码登录
- ssh 免密码登录
- ssh 免密码登录
- ssh 免密码登录
- SSH免密码登录
- ssh 免密码登录
- ssh 免密码登录
- ssh免密码登录
- SSH 登录 免密码
- SSH免密码登录
- 第二章 Basic Thread Synchronization (基础线程同步) 【上】
- HDOJ1798 Doing Homework again(贪心)
- Java程序入门(三)
- 第一次恋爱就这么结束了,又一次成了单身狗
- [Leetcode] 350. Intersection of Two Arrays II 解题报告
- ssh免密码登录的坑
- KindEditor/常见问题
- 每日一点Js(五)
- SpringCloud(五):Ribbon了解
- js高级教程 第六章-面向对象的程序设计(一)
- cf Educational Codeforces Round 26 E. Vasya's Function
- 算法学习之旅,初级篇(9)--字符串逆序
- java多线程初探
- java的基础语法(个人总结)