当前位置:网站首页>SSH login without password
SSH login without password
2022-06-29 03:24:00 【se7en_ q】
One 、 Environmental Science
operating system :CentOS
Clustered ip:192.168.241.130 hadoopnamenode
192.168.241.131 hadoopdatanode1
192.168.241.132 hadoopdatanode2
user :root, Others can be
ssh stay ~/.ssh perhaps /root/.ssh Under the directory of
Two 、 If you're starting hadoop When clustering, there are reports The authenticity of host 'localhost (127.0.0.1)' can't be established. That means you ssh Login without password failed , therefore , The cluster cannot be run normally .
1、 To configure hadoopnamenode(hadoopdatanode1|hadoopdatanode2 With hadoopnamenode For example ) Login without password localhost
a、 Get the key pair :
[email protected]:~# ssh-keygen -t rsa Or is it ssh-keygen( If your ssh Directory is id_rsa Words )
Generating public/private rsa key pair.
Enter file in which to save the key (/home/hadoop/.ssh/id_rsa):
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:
c8:5e:3e:c1:9b:52:6f:24:a5:e4:c1:1c:00:8d:fb:3b [email protected]
The key's randomart image is:
+--[ RSA 2048]----+
| .+... |
| . .o . |
| . = . |
| .. = + |
| .o S . |
| ..+ B |
| o.= o |
| E. o |
| . |
+-----------------+
b、 Save the key pair to authorkeys_keys in
[email protected]:~/.ssh# cat id_rsa.pub >> authorized_keys
c、 Set up authorized_keys jurisdiction :
# chmod 600 authorized_keys
d、 modify /etc/ssh/sshd_config In file :
1.RSAAuthentication yes # Enable RSA authentication
2.PubkeyAuthentication yes # Enable public key private key pairing authentication mode
3.AuthorizedKeysFile ~/.ssh/authorized_keys # Public key file path
e、[email protected]:#ssh localhost Verify that you can enter the local without a password
2、 To configure hadoopnamenode Login without password hadoopdatanode1 and hadoopdatanode2( Now hadoopdatanode1 For example )
a、 take namenode Copy the public key on to datanode On the machine :
#scp ~/.ssh/authorized_keys [email protected]:~/.ssh/
This command still needs to enter the password , This is normal .
b、 land hadoopdatanode1, take ssh Directory permission modification , namely ~/.ssh
chmod 700 ~/.ssh
c、 hold hadoopdatanode1 Of ssh In the catalog id_rsa.pub The content of is added to authorized_keys in
#cat ~/.ssh/id_rsa.pub >>~/.ssh/authorized_keys
d、 hold hadoopdatanode1 Medium id_rsa.pub Delete the
#rm ~/.ssh/id_rsa.pub
e、 Can be in hadoopnamenode Log on hadoopdatanode1
[email protected]:#ssh hadoopdatanode1
3、 Guarantee hadoopdatanode1 Or is it hadoopdatanode2 Login without password hadoopnamenode( With hadoopdatanode1 For example )
a、hadoopdatanode1 The public key of is appended to hadoopnamenode On
#ssh-keygen -t dsa
#cat ~/.ssh/id_dsa.pub authorized_keys
b、hadoopdatanode1 Upper id_dsa.pub Copied to the hadoopnamenode Of ssh Under the table of contents , And add the content to authorized_keys in
#scp ~/.ssh/id_dsa.pub [email protected]:~/.ssh/
#cat ~/.ssh/id_dsa.pub >>~/.ssh/authorized_keysc、 verification hadoopdatanode1 Can I log in without password hadoopnamenode
[email protected]:#ssh hadoopnamenode
Do you feel particularly irritable through the above operations ! In fact, the summary is just one sentence , stay authorized Must have hadoopnamenode Of id_rsa.pub And the secret key to hadoopdatanode Of id_dsa.pub The secret key to , That is to say namenode The public key and datanode The secret key of authorized_keys Let the cluster ssh Login without password , Whether it's master And slaver still slaver And slaver Between , It's all right . This is the result of my research , I hope it will help you all .
边栏推荐
- 图扑软件智慧能源一体化管控平台
- vim配置与使用
- LeetCode 每日一题——324. 摆动排序 II
- Yyds dry inventory everything a primary developer should know about activity
- FortiGate firewall filters the specified session and cleans it up
- 2022-2028 global MWIR camera industry research and trend analysis report
- [linear algebra] 1.1 second and third order determinants
- 2022-2028 global UAV detection radar industry research and trend analysis report
- Ten commands commonly used in SVN
- Leetcode daily question - 324 Swing sort II
猜你喜欢

FPGA(八)RTL代码之四(基本电路设计1)

2022-2028 global sound insulation coating industry research and trend analysis report

深度解析“链动2+1”模式的商业逻辑
![Movement state change of monitoring device of Jerry's watch [chapter]](/img/ff/cbc9e50a7d64e943f9f9924eadb184.jpg)
Movement state change of monitoring device of Jerry's watch [chapter]

How to understand MySQL indexes?

想当设备管理师?满足这三个报考条件就可以

Etcd教程 — 第六章 Etcd之核心API V3

Grafana入门教程
![[leetcode daily question] number of schemes to reconstruct a tree](/img/82/2ed8c9747f9fa36fde4f18cf8966be.jpg)
[leetcode daily question] number of schemes to reconstruct a tree

Grafana Getting Started tutorial
随机推荐
Certification training | streamnational certification training phase 2
19.03 容器的说明和简单应用例续
99 multiplication table
Problem - ADB shellerror: insufficient permissions for device: verify udev rules
2022-2028 global CAE engineering service industry research and trend analysis report
MATALB signal processing - signal transformation (6)
Logarithmic calculation in reverse order, logarithmic calculation in sequence -- merge sort
Jerry's monitoring alarm clock [chapter]
Redu.us took the initiative to transform, and the operation leader of China's charging pile emerged
Unable to locate program input point [email protected]
[test theory] quality analysis ability
MATALB signal processing - signal transformation (7)
2D人体姿态估计 - DeepPose
Jerry's watch begins to move [chapter]
[linear algebra] 1.1 second and third order determinants
Jerry's watch obtains alarm mode settings [chapter]
In depth analysis of Apache bookkeeper series: Part 3 - reading principle
SVN常用的十个命令
Yyds dry inventory difference between bazel and gradle tools
The method of exporting packages of all components from existing PCBs in Altium Designer