小编uli*_*tko的帖子

如何将命令行中的显式 ssh 密钥优先于 ssh-agent 密钥?

我有一堆 ssh 密钥半永久性地加载到 ssh-agent 中。ssh-add -L列出 6 个键。

我还有其他单独存储的密钥;比方说,在 USB 记忆棒上。我正好希望妥善保管所有的时间。让我给其中之一打电话square.key

问题是:在我需要的时候square.key,我可以插入 USB 记忆棒并指定-i /path/to/square.key— 但它不起作用-v揭示了原因:

debug1: Will attempt key: /home/ulidtko/.ssh/key1 RSA SHA256:<redacted> agent
debug1: Will attempt key: /home/ulidtko/.ssh/key2 RSA SHA256:<redacted> agent
debug1: Will attempt key: key3@localhost ED25519 SHA256:<redacted> agent
debug1: Will attempt key: key4@localhost RSA SHA256:<redacted> agent
debug1: Will attempt key: key5@localhost ed25519 ED25519 SHA256:<redacted> agent
debug1: Will attempt key: key6@localhost ECDSA SHA256:<redacted> agent
debug1: …
Run Code Online (Sandbox Code Playgroud)

ssh ssh-keys ssh-agent

3
推荐指数
2
解决办法
889
查看次数

标签 统计

ssh ×1

ssh-agent ×1

ssh-keys ×1