生成SSH 登录授权文件

ssh-keygen -t rsa

一路回车

cat ~/.ssh/id_rsa.pub | ssh user@目标hostname 'cat >> .ssh/authorized_keys'

登录测试

ssh -i ~/.ssh/id_rsa user@目标hostname
scp -i ~/.ssh/id_rsa ~/test.txt user@目标hostname:/home/test/test.txt

搞定,不用再用 sshpass 了

相关文章

背景:我已经有一个ssh公钥和私钥了,绑定的是公司的码云但是...
在服务器程序的部署运维过程中,我们经常需要将文件从一个服...
#!/bin/bash#创建一个以.sc结尾的文件,把要操作的主机按顺序...
打开终端安装openssh-server软件包:sudoaptupdatesudoaptins...
环境centos7.9,.NET5一、Jenkins搭建1)下载Jenkins的war包...
dropbear下载地址:https://matt.ucc.asn.au/dropbearelease...