
交換したい古いSSHキーがあり、古いキーを使用している場合は、ssh-agentに警告を表示してそのサーバーで更新する必要があることを知りたいです。
これを行う方法はありますか?
答え1
-c
オプションのキーを使用する前に確認できますssh-add
。マンページから:
-c Indicates that added identities should be subject to confirmation
before being used for authentication. Confirmation is performed
by the SSH_ASKPASS program mentioned below. Successful confirma‐
tion is signaled by a zero exit status from the SSH_ASKPASS pro‐
gram, rather than text entered into the requester.
これはキーごとです。したがって、キーを 1 つだけ追加し、-c
他のキーを追加しない可能性があります。基本プログラムはパスワードを入力するように求められますが、ユーザーがする必要があるのは[OK]または[キャンセル]をクリックするだけです(終了ステータスを意味します)。