Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Linux sets ssh secret-free access

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

1. Configuration / etc/hosts

192.168.135.130 ubuntu-64-master

192.168.135.129 ubuntu-64-slave01

192.168.135.131 ubuntu-64-slave02

2. Create a .ssh directory

3. Master nodes generate key pairs

Ssh-keygen-t rsa-P''- f ~ / .ssh/id_rsa

4. Cat ~ / .ssh/id_rsa.pub > > authorized_keys

5. Restart the sshd service

Service sshd restart

6. Verify password-free access. You need to enter a password for the first time, but not later.

Ssh ubuntu-64-master

7. After the secret-free access of the master node is successful, copy the files in the .ssh directory to the ubuntu-64-slave01,ubuntu-64-slave02 remotely.

Scp-r ~ / .ssh/* root@192.168.135.129:~/.ssh

Scp-r ~ / .ssh/* root@192.168.135.131:~/.ssh

8. Similarly, restart the sshd service

Service sshd restart

9. Verify password-free access

Ssh ubuntu-64-slave01

Ssh ubuntu-64-slave02

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report