6
A
回答
8
可以使用-i
選項。
來源:man ssh
-i identity_file
Selects a file from which the identity (private key) for public key authentication is read. The default is ~/.ssh/identity for protocol
version 1, and ~/.ssh/id_dsa, ~/.ssh/id_ecdsa and ~/.ssh/id_rsa for protocol version 2. Identity files may also be specified on a per-
host basis in the configuration file. It is possible to have multiple -i options (and multiple identities specified in configuration
files). ssh will also try to load certificate information from the filename obtained by appending -cert.pub to identity filenames.
2
您還可以添加特定的配置,您訪問的每個主機,這是幾乎一樣堅持以SSH提供的標誌的使用。
有一個可用的標誌的整個世界,併爲每個不同的服務專業化提供了一些映射。在你的情況下,使用特定的id_rsa
文件,你可以寫下你的~/.ssh/config
文件:
...
Host host_alias
HostName host_name
IdentityFile ~/.ssh/id_rsa_you_want
...
然後,您可以簡單地使用:
ssh host_alias
而且id_rsa_you_want
將使用 - 以及您可以將任何進一步的配置應用於連接。有關可用指令的完整列表,請參閱man ssh_config
。
相關問題
- 1. ssh-add,自動添加一個私鑰
- 2. 用私鑰testinfra ssh執行
- 3. SourceTree終端自動加載ssh密鑰
- 4. 添加的私鑰SSH代理
- 5. Git ssh私鑰密碼
- 6. 加載私鑰失敗,OpenSSL.crypto.Error:[]
- 7. 私鑰/公鑰ssh-keygen -t rsa
- 8. 如何查找.ssh私鑰和公鑰
- 9. 從ssh中的公鑰生成私鑰
- 10. sftp vs ssh公鑰/私鑰(初學者)
- 11. Azure ARM模板 - ssh公鑰和私鑰
- 12. ssh私鑰/公鑰認證示例
- 13. 私鑰ssh不適用於用戶jenkins
- 14. ssh從ssh會話中使用不正確的ssh私鑰
- 15. 如何用私鑰ssh深入兩個?
- 16. 在TortoiseGit上使用ssh私鑰
- 17. MySQL root用SSH登錄私鑰?
- 18. 使用Python生成私鑰/公鑰SSH密鑰
- 19. Teamcity SSH私鑰登錄失敗:無效私鑰
- 20. 無法加載從RSA私鑰文件的私鑰在C#
- 21. 如何使用加密的私鑰與golang ssh
- 22. Ant能否使用SSH加密來自Pageant的私鑰?
- 23. 在Tamir .Net上使用SSH私鑰1.1 SSH庫
- 24. 構建Docker時無法使用私鑰進行SSH SSH鏡像
- 25. 通過Linux的PowerShell使用私鑰ssh登錄自動化?
- 26. Bouncycastle加密私鑰PEM輸出:RSA私鑰與私鑰
- 27. 從SSH自動卸載密鑰
- 28. 使用ssh從私鑰創建發佈密鑰
- 29. 使用公鑰和私鑰進行SSH通信
- 30. 存儲〜/ .ssh以外的私鑰