1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

ssh-agentでsshのパスワード入力を省略

Last updated at Posted at 2023-06-06

やりたいこと

ssh接続をするたびに、passphrase を入力するのはもう終わりにする

$ git pull
Enter passphrase for key '/home/user/.ssh/id_rsa': # passphraseを入力

:frowning2: sshでのやりとりで毎回passphrase の入力を要求されるのはストレス

やること

passphrase を一度だけ登録

# ssh-agentを起動
$ ssh-agent bash

# 秘密鍵を登録
$ ssh-add /home/user/.ssh/id_rsa # ssh-add [秘密鍵へのファイルパス]
Enter passphrase for /home/user/.ssh/id_rsa: # passphraseを入力
Identity added: /home/user/.ssh/id_rsa (test@example.com)

:blush: ssh-agent を起動して秘密鍵を登録しておけば、sshで実行した際に秘密鍵を自動的に適用して認証処理を行ってくれる
:blush: ssh-agent は一度起動すると、バックグラウンドで稼働し続ける

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?