SSH配置免密码登录堡垒机
1、生成rsa、rsa.pub秘钥对
命令:ssh-keygen -t rsa -C "$your_email"
生成的密钥对存在文件夹 ~/.ssh 中,为了区分不同的秘钥对,在生成后制定文件名时分别加后缀, 如github,gitlab。
2、将各个pub文件(公钥文件)分别上传至对应的服务器,ssh-copy-id -i xxx.pub HOST,
3、在 ~/.ssh 中建立config文件,vim config,内容如下:
host *
ControlMaster auto
ControlPath ~/.ssh/master-%r@%h:%p
ServerAliveInterval 80
Host js
HostName 192.168.1.1
Port 123456
User root
IdentityFile ~/.ssh/id_rsa4、然后就可以直接使用ssh js 登录到对应的服务器了,js 为config文件中Host的名称
欢迎订阅「K叔区块链」 - 专注于区块链技术学习

博客地址:http://www.jouypub.com
简书主页:https://www.jianshu.com/u/756c9c8ae984
segmentfault主页:https://segmentfault.com/blog/jouypub
腾讯云主页:https://cloud.tencent.com/developer/column/72548
相关推荐
projava 2020-11-14
WanKaShing 2020-11-12
airfish000 2020-09-11
tryfind 2020-09-14
yegen00 2020-09-10
kkaazz 2020-09-03
风语者 2020-09-02
BraveWangDev 2020-08-19
lichuanlong00 2020-08-15
gsl 2020-08-15
pandaphinex 2020-08-09
yhuihon 2020-08-09
CheNorton 2020-08-02
xiangqiao 2020-07-28
hpujsj 2020-07-26
hpujsj 2020-07-26
sshong 2020-07-19
BraveWangDev 2020-07-19
annan 2020-07-18