SSH免密码登陆
2016-07-29 17:51
357 查看
在linux安装hadoop是为了以后操作方便可以进行免密码设置
1 . 在Xshell 输入 cd 回到当前用户界面
2 输入下面命令
ssh-keygen -t rsa "" 输入这个命令后一直回车就可以了
[root@hadoop ~]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
/root/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
b4:75:7a:87:6b:48:4a:48:39:e4:6c:a3:11:fe:ad:38 root@hadoop
The key's randomart image is:
+--[ RSA 2048]----+
| . . |
| . = . |
| o O . . . |
| * * o o . |
| . o S o o . |
| . o o o o |
| E . . . o |
| . . |
| |
+-----------------+
出现如上所示,基本上一直按enter
2 将生成的公钥id_rsa.pub
内容追加到authorized_keys(执行命令:cat id_rsa.pub >> authorized_keys
[root@hadoop ~]# cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
安全起见,你可以退出linux再以root登陆进来一下,我是没做这个步骤
相关文章推荐
- HDU1318 POJ1590 UVA401 ZOJ1325 Palindromes【回文+水题】
- 去掉chrome记住密码后自动填充表单的黄色背景
- Android-->模仿360底部导航按钮
- poj 1279
- linux下Ping工具的C语言实现
- Gson解析json数组
- JAVASE总结--08(封装、继承、多态)
- 跨域问题节解决问题汇总
- HttpURLConnection网络请求
- javaweb学习总结(三十四)——使用JDBC处理MySQL大数据
- Python中self的含义
- mysql权限问题
- 南歌子.记2016年仲夏独上平江石牛寨过玻璃天桥
- POJ1006 Biorhythms (CRT)
- HDU 5015 233 Matrix 【矩阵快速幂】
- HDU 2191悼念512汶川大地震遇难同胞——珍惜现在,感恩生活
- data table使用
- Java变量
- Java静态与同步
- gcc常用命令