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

Implementation of ssh Secret-free Communication in linux

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

What is ssh?

The administrator can manage and operate multiple hosts which are connected by the network and are scattered everywhere by means of remote login.

An administrator can do the following for a remote host:

Remote login remote command to perform remote file transfer

The pity is that these operations are not safe!

Use a plain text password and send it in clear text

Information may be intercepted, and passwords may be retrieved. Unauthorized personnel may use the intercepted password to log on to the system, causing harm to the system.

During daily practice, you may need to enter your login password every time you log in to other hosts with ssh, even if you use scp to copy things.

In order to switch hosts more conveniently and quickly, ssh secret-free communication is a better choice.

Use ssh-keygen to generate the key, which is saved locally by default in / root/.ssh/id_rsa

Then distribute to the target host with ssh-copy-id; login user @ hostname or IP address

Note:

1. It is best to use the hostname and write the hostname and the corresponding IP address in the / etc/hosts file

two。 Secret-free communication requires mutual authentication, so you also need to do the same operation to the local machine on the target host.

[root@www ~] # ssh-keygen-t rsa-P''Generating public/private rsa key pair.Enter file in which to save the key (/ root/.ssh/id_rsa): / root/.ssh/id_rsa already exists.Overwrite (YPorta)? [root@www ~] # ssh-copy-id-I. ssh / id_rsa.pub root@172.16.75.1/usr/bin/ssh-copy-id: INFO: Source of key (s) to be installed: ".ssh / id_rsa.pub" The authenticity of host '172.16.75.1 (172.16.75.1)' can't be established.ECDSA key fingerprint is SHA256:YXhbTS9MfK2IQC4gtOW4RL8voHvFqC1cAAMJXuF3Wec.ECDSA key fingerprint is MD5:2c:c0:94:e8:3a:e4:74:88:c0:d8:e0:01:20:81:1d:8e.Are you sure you want to continue connecting (yes/no)? Yes/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key (s), to filter out any that are already installed/usr/bin/ssh-copy-id: INFO: 1 key (s) remain to be installed-- if you are prompted now it is to install the new keysroot@172.16.75.1's password: Number of key (s) added: 1Now try logging into the machine, with: "ssh 'root@172.16.75.1'" and check to make sure that only the key (s) you wanted were added.

The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will 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