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

How to realize ssh password-free login of Linux host

2025-01-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

Today, I will show you how to achieve Linux host ssh password-less login. The content of the article is good. Now I would like to share it with you. Friends who feel in need can understand it. I hope it will be helpful to you. Let's read it along with the editor's ideas.

# generate the public key (in the simplest way, use the following command to enter all the way) # after running, the id_rsa and id_ras.pub files will be generated in the $HOME/.ssh directory # rsa refers to the encryption algorithm ssh-keygen-t rsa# to copy the public key on the local machine to the host that needs to log in remotely from the local machine # the target host owns the local public key file, indicating that the local machine is trusted to the target host The reliable # copy command is simple as follows (it is best not to copy it manually, too much human operation means more errors) # this process requires entering the password of the target host because the public key file needs to be transferred over the network to ssh-copy-id-I root@targethost

Simple application scenarios:

Linux_hostA: {IP:192.168.1.12,user:admin} linux_hostB: {IP:192.168.1.145,user:admin}

Implement password-free access between AMagi B, and between AMagi An and BMagne B.

# generate the public key of host A [admin@192.168.1.12] ssh-keygen-t rsa#A can access A [admin @ 192.168.1.12] ssh-copy-id-I admin@localhost#A without password and access B [admin @ 192.168.1.12] ssh-copy-id-I admin@192.168.1.145# without password to generate the public key of host B [admin@192.168.1.145] ssh-keygen-t rsa # B can access B [admin @ 192.168.1.145] ssh-copy-id-I admin@localhost#B without password and A [admin @ 192.168.1.145] ssh-copy-id-I admin@192.168.1.12 without password

After the above steps, you will not need a password to log in to the target host through ssh admin@targethost

The above is how to achieve Linux host ssh password-free login of all the content, more and how to achieve Linux host ssh password-free login-related content can search the previous article or browse the following article to learn ha! I believe the editor will add more knowledge to you. I hope you can support it!

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