Implementation of ssh non-secret communication in linux

Implementation of ssh non-secret communication in linux

What is ssh

Administrators can log in remotely to manage multiple hosts located in different locations that are connected via the Internet.

Administrators can perform the following operations on remote hosts:

  • Remote login
  • Remote Command Execution
  • Remote file transfer

Unfortunately, these operations are not safe!

Use plain text passwords and send them in clear text

  • Information may be intercepted and passwords may be retrieved
  • Unauthorized personnel use intercepted passwords to log into the system and cause damage to the system

During daily operation practice, when logging in to other hosts with ssh, you may need to enter the login password every time, even when using scp to copy something.

In order to switch hosts more conveniently and quickly, ssh non-encrypted communication is a better choice;

Generate a key using ssh-keygen, which is saved locally by default in /root/.ssh/id_rsa

Then use ssh-copy-id to distribute to the target host; log in as user@host name or IP address

Notice:

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

2. Password-free communication requires mutual authentication between both parties, so the same operation needs to be performed 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 (y/n)?
[root@www ~]#ssh-copy-id -i .ssh/id_rsa.pub [email protected]
/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 keys
[email protected]'s password: 
Number of key(s) added: 1
Now try logging into the machine, with: "ssh '[email protected]'"
and check to make sure that only the key(s) you wanted were added.

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Detailed explanation of how to pass password to ssh/scp command in bash script
  • Detailed explanation of how to mount remote file systems via SSH on Linux
  • CentOS method to modify the default ssh port number example
  • Detailed installation and use of SSH in Ubuntu environment
  • Instructions for deploying projects to remote machines using the Publish Over SSH plugin in Jenkins
  • CentOS 6.5 configuration ssh key-free login to execute pssh command explanation
  • Ubuntu basic settings: installation and use of openssh-server
  • How to install MySQL via SSH on a CentOS VPS
  • How to configure ssh/sftp and set permissions under Linux operating system
  • Explanation of Mac connecting to remote servers through SSH in different terminals

<<:  How to achieve 3D dynamic text effect with three.js

>>:  Detailed explanation of how to restore database data through MySQL binary log

Recommend

HTML Table Tag Tutorial (47): Nested Tables

<br />In the page, typesetting is achieved b...

Specific use of Node.js package manager npm

Table of contents Purpose npm init and package.js...

Detailed explanation of JavaScript clipboard usage

(1) Introduction: clipboard.js is a lightweight J...

Details of MutationObServer monitoring DOM elements in JavaScript

1. Basic Use It can be instantiated through the M...

Detailed explanation of MySQL injection without knowing the column name

Preface I feel like my mind is empty lately, as I...

Correct way to load fonts in Vue.js

Table of contents Declare fonts with font-face co...

Install MySQL 5.7.17 in win10 system

Operating system win10 MySQL is the 64-bit zip de...

React's context and props explained

Table of contents 1. context 1. Usage scenarios 2...

Echarts Basic Introduction: General Configuration of Bar Chart and Line Chart

1Basic steps of echarts Four Steps 1 Find the DOM...

Comprehensive explanation of CocosCreator hot update

Table of contents Preface What is Hot Change Coco...

Analysis of the process of deploying pure HTML files in Tomcat and WebLogic

1. First, the pure HTML file must have an entry i...

How to implement hot deployment and hot start in Eclipse/tomcat

1. Hot deployment: It means redeploying the entir...

Integration practice of Vue+Element background management framework

Table of contents Vue+ElementUI background manage...

Detailed explanation of the usage of compose function and pipe function in JS

Table of contents compose function Array.prototyp...