ssh 无密码登录要使用公钥与私钥。linux下可以用用ssh-keygen生成公钥/私钥对

1.添加A服务器公钥到B服务器

2.到A服务器输入命令ssh-keygen  一路回车

 3.找到A服务器的/root/.ssh/id_rsa.pub 打开复制内容

4.找到B服务器的/root/.ssh/authorized_keys 将A服务器的id_rsa.pub公钥内容复制进去即可

或者使用命令

##在A服务器上执行
scp /root/.ssh/id_rsa.pub root@10.2---21:/root/.ssh/authorized_keys

GitHub 加速计划 / li / linux-dash
13
2
下载
A beautiful web dashboard for Linux
最近提交(Master分支:4 个月前 )
186a802e added ecosystem file for PM2 5 年前
5def40a3 Add host customization support for the NodeJS version 5 年前
Logo

AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。

更多推荐