当前位置:网站首页>SSH password free login - two virtual machines establish password free channel two-way trust
SSH password free login - two virtual machines establish password free channel two-way trust
2022-07-29 07:01:00 【hgswnsa】
List of articles
Establishment of secret free passage
Prepare two virtual machines , Use root user
A:192.168.225.130
B:192.168.225.134
Three steps :
1、 Generating key pairs locally
2、 Upload the public key to the other machine
3、 verification : Log in to the other machine remotely
1、 Generating key pairs locally
Generate key pair , stay A Machine use root User generated key pair , The key pair is placed under the user's home directory
perform ssh-keygen -t rsa command , Keep pressing enter

2、 Upload the public key to B machine , requirement B Machine permission root The user login
Use ssh-copy-id -i /root/.ssh/id_rsa.pub [email protected] command , hold A The public key of the machine is given to B machine
-i Specify the public key file

3、 Verify whether a password is required for login
Use ssh -p 22 [email protected] command , Directly in A Machine remote login B machine
-p Designated port
You can see that you don't need to enter a password , Remote login to B machine 
The above is the establishment of one-way trust ,A To B Secret free passage of , The following will establish B To A Secret free passage of
The operation steps are the same as above ,B Machine as a local machine ,A The machine acts as a remote machine
1、 Generating key pairs locally
ssh-keygen -t rsa

2、 Upload the public key to A machine , requirement A Machine permission root The user login
ssh-copy-id -i /root/.ssh/id_rsa.pub [email protected]

3、 Verify whether a password is required for login
ssh -p 22 [email protected]

thus , Two way trust establishment is complete ,A The machine can log in remotely B machine ,B The machine can also log in remotely A machine
summary
Establishing a secret free channel is actually two steps : Generating key pairs locally , Give the public key to the remote machine
边栏推荐
猜你喜欢

MySQL: what happens in the bufferpool when you crud? Ten pictures can make it clear

【讲座笔记】如何在稀烂的数据中做深度学习?

基于C语言实现图书借阅管理系统

LDAP brief description and unified authentication description

Unity free element special effect recommendation

【CryoEM】FSC, Fourier Shell Correlation简介

游戏资产的革命

Leetcode-592: fraction addition and subtraction

JMM memory model concept

阿里一面,给了几条SQL,问需要执行几次树搜索操作?
随机推荐
vscode通过remotessh结合xdebug远程调试php解决方案
Excerpts from good essays
王树尧老师运筹学课程笔记 01 导学与绪论
leetcode-1331:数组序号转换
新同事写了几段小代码,把系统给搞崩了,被老板爆怼一顿!
吴恩达老师机器学习课程笔记 03 线性代数回顾
基于C语言设计的学生成绩排名系统
Relative date used by filter in salesforce
Analog volume leetcode [normal] 093. Restore IP address
模拟卷Leetcode【普通】172. 阶乘后的零
数据库持久化+JDBC数据库连接
矩阵分解与梯度下降
吴恩达老师机器学习课程笔记 01 引言
The core of openresty and cosocket
Simulation volume leetcode [ordinary] 172. Zero after factorial
王树尧老师运筹学课程笔记 04 线性代数基础
王树尧老师运筹学课程笔记 03 KKT定理
Not so simple singleton mode
10 frequently asked JVM questions in interviews
【论文阅读 | cryoET】Gum-Net:快速准确的3D Subtomo图像对齐和平均的无监督几何匹配