dmo*_*ati 50
一种可能的选择是使用sftp -oIdentityFile=/path/to/private/keyfile. 需要更多信息来说明这是否适合您。似乎在 Mac/Linux 下工作。
slu*_*man 22
您可以简单地将-i参数用于 sftp 或 ssh 命令。
sftp -i /path/to/private/keyfile ...
Run Code Online (Sandbox Code Playgroud)
如果 -i 选项不可用,您可以使用 -o 选项,语法如下:
sftp -oIdentityFile=/path/to/private/keyfile ...
Run Code Online (Sandbox Code Playgroud)
use*_*517 10
您可以为连接创建备用配置文件,并使用-F开关告诉 ssh 使用它。使用内容创建一个配置文件,例如 ~/.ssh/config.sftp
Host remote.host.tld
User RemoteUserName
IdentityFile /path/to/atlernate/identityfile
Run Code Online (Sandbox Code Playgroud)
然后像这样调用sftp
sftp -F ~/.ssh/config.sftp remote.host.tld
Connecting to remote.host.tld...
Enter passphrase for key '/path/to/atlernate/identityfile':
sftp>
Run Code Online (Sandbox Code Playgroud)
上面的配置将备用键的使用(当使用此配置文件时)限制为 remote.host.tld 上的用户 RemoteUserName。
查看ssh_confg的手册页以了解备用配置文件的用法
| 归档时间: |
|
| 查看次数: |
203524 次 |
| 最近记录: |