栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

杨校老师课堂之集群内SSH免密登录功能配置

杨校老师课堂之集群内SSH免密登录功能配置

SSH免密登录功能配置

1. 在主节点虚拟机内进行如下操作:

[root@hadoop1 tmp]# ssh-keygen -t rsa

Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): 
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:
SHA256:Lr4xmEQSRRyRN2LSirJZYyi0/OdAUhWHzZF8o4ZmHYY root@hadoop1
The key's randomart image is:
+---[RSA 2048]----+
|  .=**Boo        |
| ..o*E+B o       |
|oo++.o+.+ .      |
|=+=+ + +         |
|o=+.+ . S        |
|o  + + .         |
|    * + .        |
|     o +         |
|      o.         |
+----[SHA256]-----+
[root@hadoop1 tmp]# 


根据提示完成三次回车即可。

2. 切换到 root的家目录下,查看文件

[root@hadoop1 tmp]# cd /root/
[root@hadoop1 ~]# ll -a
总用量 52
dr-xr-x---. 16 root root 4096 3月  23 12:55 .
dr-xr-xr-x. 17 root root  224 3月  22 02:19 ..
-rw-------.  1 root root 1615 3月  22 02:20 anaconda-ks.cfg
-rw-r--r--.  1 root root   18 12月 29 2013 .bash_logout
-rw-r--r--.  1 root root  176 12月 29 2013 .bash_profile
-rw-r--r--.  1 root root  176 12月 29 2013 .bashrc
drwx------. 14 root root 4096 3月  23 12:56 .cache
drwxr-xr-x. 14 root root  261 3月  23 12:55 .config
-rw-r--r--.  1 root root  100 12月 29 2013 .cshrc
drwx------.  3 root root   25 3月  22 03:52 .dbus
-rw-------.  1 root root   16 3月  23 12:55 .esd_auth
-rw-------.  1 root root  314 3月  23 12:54 .ICEauthority
-rw-r--r--.  1 root root 1629 3月  23 13:02 initial-setup-ks.cfg
drwx------.  3 root root   19 3月  23 12:54 .local
drwx------.  5 root root   66 3月  23 12:55 .mozilla
drwx------.  2 root root   57 3月  23 13:11 .ssh
-rw-r--r--.  1 root root  129 12月 29 2013 .tcshrc
-rw-------.  1 root root 2758 3月  23 12:45 .viminfo
-rw-------.  1 root root  104 3月  23 2022 .xauth1MBjab
drwxr-xr-x.  2 root root    6 3月  23 12:55 公共
drwxr-xr-x.  2 root root    6 3月  23 12:55 模板
drwxr-xr-x.  2 root root    6 3月  23 12:55 视频
drwxr-xr-x.  2 root root    6 3月  23 12:55 图片
drwxr-xr-x.  2 root root    6 3月  23 12:55 文档
drwxr-xr-x.  2 root root    6 3月  23 12:55 下载
drwxr-xr-x.  2 root root    6 3月  23 12:55 音乐
drwxr-xr-x.  2 root root    6 3月  23 12:55 桌面
[root@hadoop1 ~]# 
    进入.ssh目录内查看文件
[root@hadoop1 ~]# cd .ssh/

[root@hadoop1 .ssh]# ll -a
总用量 16
drwx------.  2 root root   57 3月  23 13:11 .
dr-xr-x---. 16 root root 4096 3月  23 12:55 ..
-rw-------.  1 root root 1675 3月  23 13:11 id_rsa
-rw-r--r--.  1 root root  394 3月  23 13:11 id_rsa.pub
-rw-r--r--.  1 root root  541 3月  23 12:48 known_hosts

上述查询到的id_rsa就是hadoop1的私钥、id_rsa.pub则是hadoop的公钥

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/780751.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号