linux生成多对秘钥并指定秘钥登录

1.生成秘钥对并指定秘钥对名称:

ssh-keygen -t rsa -f other -C "for other"

2.将other.pub公钥添加至要免密登录的服务器

3.使用指定other私钥登录远程服务器:

ssh -i ~/.ssh/other 124.202.149.13 -p36000

4.指定私钥远程scp

scp -P36000  -i ~/.ssh/other jiradb-2019-05-20.sql 124.202.149.13:/data/backup/jira/
原文地址:https://www.cnblogs.com/sunshine-long/p/10893150.html