我是靠谱客的博主 阔达纸飞机,最近开发中收集的这篇文章主要介绍Hadoop用户配置ssh互相通信,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

1.创建hadoop用户

[root@ruozedata001 ~]# useradd hadoop
[root@ruozedata001 ~]# id hadoop
uid=1102(hadoop) gid=1102(hadoop) groups=1102(hadoop)
[root@ruozedata001 ~]# passwd hadoop
Changing password for user hadoop.
New password:
BAD PASSWORD: it is too simplistic/systematic
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication tokens updated successfully.
#给hadoop sudo权限
[root@ruozedata001 ~]# vi /etc/sudoers
hadoop ALL=(root) NOPASSWD:ALL

2.切换到hadoop用户 配置免密登录

[root@ruozedata001 ~]# su - hadoop
#确保有ssh服务
[hadoop@ruozedata001
~]$ sudo service sshd status
openssh-daemon (pid
24823) is running...
[hadoop@ruozedata001 ~]$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/hadoop/.ssh/id_rsa):
Created directory '/home/hadoop/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/hadoop/.ssh/id_rsa.
Your public key has been saved in /home/hadoop/.ssh/id_rsa.pub.
The key fingerprint is:
81:fa:32:ce:c4:e4:bb:66:fa:a6:33:d1:9c:e6:9a:38 hadoop@ruozedata001
The key's randomart image is:
+--[ RSA 2048]----+
|
|
|
.
|
|
. .
|
|
.
.
|
|
oo.
S
|
|
.+=.
|
|
+* .
|
|E.o==+
|
|..=@*.
|
+-----------------+
[hadoop@ruozedata001 ~]$ cd .ssh/
[hadoop@ruozedata001 .ssh]$ ll
total 8
-rw------- 1 hadoop hadoop 1675 May 17 14:59 id_rsa
-rw-r--r-- 1 hadoop hadoop
395 May 17 14:59 id_rsa.pub
[hadoop@ruozedata001 .ssh]$ cat id_rsa.pub >> authorized_keys
[hadoop@ruozedata001 .ssh]$ ll
total 12
-rw-rw-r-- 1 hadoop hadoop
395 May 17 14:59 authorized_keys
-rw------- 1 hadoop hadoop 1675 May 17 14:59 id_rsa
-rw-r--r-- 1 hadoop hadoop
395 May 17 14:59 id_rsa.pub
#authorized_keys权限必须为600
[hadoop@ruozedata001 .ssh]$ chmod 600 authorized_keys
[hadoop@ruozedata001 .ssh]$ ssh hadoop000 date
The authenticity of host 'hadoop000 (192.168.6.217)' can't be established.
RSA key fingerprint is 25:d9:d6:7e:fa:e0:a7:92:7c:06:76:5c:2b:19:bf:a3.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'hadoop000,192.168.6.217' (RSA) to the list of known hosts.
Thu May 17 15:00:28 CST 2018
[hadoop@hadoop000 .ssh]$ ssh hadoop000 date
Thu May 17 15:00:30 CST 2018

 

最后

以上就是阔达纸飞机为你收集整理的Hadoop用户配置ssh互相通信的全部内容,希望文章能够帮你解决Hadoop用户配置ssh互相通信所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(60)

评论列表共有 0 条评论

立即
投稿
返回
顶部