通过 SSH 隧道使用不同公钥通过 FileZilla 进行 SFTP

通过 SSH 隧道使用不同公钥通过 FileZilla 进行 SFTP

我已经设置了 SSH 隧道,通过 FileZilla 连接到 AWS 传输服务器

ssh -i ~/bastion-server.pem -L 3111:vpce-id.eu-west-3.vpce.amazonaws.com:22 [email protected]

运行良好。

然后在 FileZilla 中我有我的连接字符串

Host: 127.0.0.1 Port:3111 Username:sftpuser key:transfer-server.pem

FileZilla 日志显示

Status:         Connecting to 127.0.0.1:3111...
Status:         Using username "Username:sftpuser". 
Status:         Authenticating with public key "~/bastion-server.pem" from agent 

为什么 FileZilla 使用 bastion-server.pem 以及如何让它使用 transfer-server.pem

答案1

FileZilla 仅仅使用它在中找到的键ssh-agent

试着看看上面ssh-add -l说了什么,你就会明白为什么它使用那个键。我不使用 FileZilla,但我认为它会寻找它~/.ssh/id_{ed25519,rsa}无法找到的标准键,然后返回到它唯一可用的键。

要么配置 FileZilla 条目来指定一个键,要么简单地使用scp(或者更好的是,rsync如果可能的话)支持在命令行上指定键。

相关内容