LoginSignup
6
6

More than 5 years have passed since last update.

秘密鍵のパスフレーズ入力をスルーする

Last updated at Posted at 2013-04-11

秘密鍵のパスフレーズ入力をスルーする。

ShellScriptでSCPやらなんやら使おうとしたら、鍵認証しか出来ない。
しかもパスフレーズかかってる。

環境変数の変更

[root@localhost ~]# eval `/usr/bin/ssh-agent`
Agent pid 5148

秘密鍵の追加

ssh-addを使用してssh-agentに秘密鍵を登録し、パスフレーズを維持する。

[root@localhost ~]# ssh-add ~/.ssh/id_rsa

Enter passphrase for /root/.ssh/id_rsa: ←ここでパスフレーズ入力

Identity added: /root/.ssh/id_rsa (/root/.ssh/id_rsa)

※もちろん公開鍵は接続先のAuthorized_keysへ。

接続確認

SSHを叩いてみて、スルー出来ればOK

[root@localhost ~]# ssh remote
6
6
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
6
6