:公告:优快云博客频道推出博客导出工具(开源) 公告:优快云博客频道推出文章目录功能 优快云产品客服新浪微博正式上线
移动开发者大会最新议题发布,八折抢票! 2013年1月微软MVP申请开始啦! “第一次亲密接触”—有奖征文活动
ubuntu 中ssh无密码配置 ,hadoop节点之间无密码登录 .
分类: Linux 2011-03-16 21:45 1730人阅读 评论(0) 收藏 举报
今天在搭建hadoop环境配置的时候,需要ssh无密码登录,费了九牛二虎之力,终于搞定了。
首先,不同的linux操作系统,可能之间的命令有一些少许的不同,我的操作系统是ubuntu,所以把我所搞的记录下来。
1、hadoop02@ubuntuserver2:/root$ ssh-keygen -t rsa 命令,出现一下结果,我一直按Enter,按到最后,
[cpp] view plaincopyprint?
01.Generating public/private rsa key pair.
02.Enter file in which to save the key (/home/hadoop02/.ssh/id_rsa):
03.Enter passphrase (empty for no passphrase):
04.Enter same passphrase again:
05.Your identification has been saved in /home/hadoop02/.ssh/id_rsa.
06.Your public key has been saved in /home/hadoop02/.ssh/id_rsa.pub.
07.The key fingerprint is:
08.0f:7e:45:6c:40:7c:9d:46:c5:12:31:09:5c:2c:4a:aa hadoop02@ubuntuserver2
09.The key's randomart image is:
10.+--[ RSA 2048]----+
11.| oo..**B.| 。
12.| oo+ B..|
13.| o o+o . |
14.| . .o |
15.| .S . |
16.| E. o . |
17.| . o |
18.| . |
19.| |
20.+-----------------+
Generating public/private rsa key pair.
Enter file in which to save the key (/home/hadoop02/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/hadoop02/.ssh/id_rsa.
Your public key has been saved in /home/hadoop02/.ssh/id_rsa.pub.
The key fingerprint is:
0f:7e:45:6c:40:7c:9d:46:c5:12:31:09:5c:2c:4a:aa hadoop02@ubuntuserver2
The key's randomart image is:
+--[ RSA 2048]----+
| oo..**B.|
| oo+ B..|
| o o+o . |
| . .o |
| .S . |
| E. o . |
| . o |
| . |
| |
+-----------------+
2root$ cat .ssh/id_rsa.pub >> .ssh/authorized_keys
注意:cat 与.ssh之间有空格,id_rsa.pub与>>之间有空格
3、hadoop02@ubuntuserver2:~$ cd .ssh
4、hadoop02@ubuntuserver2:~$ ls -a
authorized_keys id_rsa id_rsa.pub
5、hadoop02@ubuntuserver2:~/.ssh$ ssh localhost 进行检测,是否无密码登录
6、把hadoop02中的id_rsa.pub拷贝到hadoop01中
hadoop02@ubuntuserver2:~/.ssh$ scp id_rsa.pub hadoop01@192.168.1.135:/home/hadoop01
注意:hadoop01@192.168.1.135在ubuntu操作系统中必须这样写,否则就会出现错误。这可能跟其他的linux操作系统不同,hadoop01是你的登录名,192.168.1.135是IP地址。
这样就可以传递成功!
7、hadoop01@hadoop-master:~$ cat id_rsa.pub >> .ssh/authorized_keys(.ssh也在/home/hadoop01目录下)
注意这个要在/hadoop01目录中,完成这部之后,hadoop02访问hadoop01就不需要密码访问了。
8、测试一下:在hadoop02中,ssh hadoop01@192.168.1.135 测试一下是否直接可以控制hadoop01了!
移动开发者大会最新议题发布,八折抢票! 2013年1月微软MVP申请开始啦! “第一次亲密接触”—有奖征文活动
ubuntu 中ssh无密码配置 ,hadoop节点之间无密码登录 .
分类: Linux 2011-03-16 21:45 1730人阅读 评论(0) 收藏 举报
今天在搭建hadoop环境配置的时候,需要ssh无密码登录,费了九牛二虎之力,终于搞定了。
首先,不同的linux操作系统,可能之间的命令有一些少许的不同,我的操作系统是ubuntu,所以把我所搞的记录下来。
1、hadoop02@ubuntuserver2:/root$ ssh-keygen -t rsa 命令,出现一下结果,我一直按Enter,按到最后,
[cpp] view plaincopyprint?
01.Generating public/private rsa key pair.
02.Enter file in which to save the key (/home/hadoop02/.ssh/id_rsa):
03.Enter passphrase (empty for no passphrase):
04.Enter same passphrase again:
05.Your identification has been saved in /home/hadoop02/.ssh/id_rsa.
06.Your public key has been saved in /home/hadoop02/.ssh/id_rsa.pub.
07.The key fingerprint is:
08.0f:7e:45:6c:40:7c:9d:46:c5:12:31:09:5c:2c:4a:aa hadoop02@ubuntuserver2
09.The key's randomart image is:
10.+--[ RSA 2048]----+
11.| oo..**B.| 。
12.| oo+ B..|
13.| o o+o . |
14.| . .o |
15.| .S . |
16.| E. o . |
17.| . o |
18.| . |
19.| |
20.+-----------------+
Generating public/private rsa key pair.
Enter file in which to save the key (/home/hadoop02/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/hadoop02/.ssh/id_rsa.
Your public key has been saved in /home/hadoop02/.ssh/id_rsa.pub.
The key fingerprint is:
0f:7e:45:6c:40:7c:9d:46:c5:12:31:09:5c:2c:4a:aa hadoop02@ubuntuserver2
The key's randomart image is:
+--[ RSA 2048]----+
| oo..**B.|
| oo+ B..|
| o o+o . |
| . .o |
| .S . |
| E. o . |
| . o |
| . |
| |
+-----------------+
2root$ cat .ssh/id_rsa.pub >> .ssh/authorized_keys
注意:cat 与.ssh之间有空格,id_rsa.pub与>>之间有空格
3、hadoop02@ubuntuserver2:~$ cd .ssh
4、hadoop02@ubuntuserver2:~$ ls -a
authorized_keys id_rsa id_rsa.pub
5、hadoop02@ubuntuserver2:~/.ssh$ ssh localhost 进行检测,是否无密码登录
6、把hadoop02中的id_rsa.pub拷贝到hadoop01中
hadoop02@ubuntuserver2:~/.ssh$ scp id_rsa.pub hadoop01@192.168.1.135:/home/hadoop01
注意:hadoop01@192.168.1.135在ubuntu操作系统中必须这样写,否则就会出现错误。这可能跟其他的linux操作系统不同,hadoop01是你的登录名,192.168.1.135是IP地址。
这样就可以传递成功!
7、hadoop01@hadoop-master:~$ cat id_rsa.pub >> .ssh/authorized_keys(.ssh也在/home/hadoop01目录下)
注意这个要在/hadoop01目录中,完成这部之后,hadoop02访问hadoop01就不需要密码访问了。
8、测试一下:在hadoop02中,ssh hadoop01@192.168.1.135 测试一下是否直接可以控制hadoop01了!
3278

被折叠的 条评论
为什么被折叠?



