LoginSignup
0
0

sshキー接続が繋がらない時の対処法

Last updated at Posted at 2023-04-25

準備

sshキーを作成します。
sshキーを作成したら次にconfigファイルを作成します。

$ touch ~/.ssh/config

ls ~/.ssh/でconfigファイルが表示されればOKです。

ssh add

configファイルを作成したら、

$ ssh-add -l
>2048 SHA256:ZUc........ /Users/username/.ssh/id_rsa (RSA)

この表示になればOKです。もし、

$ ssh-add -l
>The agent has no identities.

このような表示がされた場合は、

$ ssh-add

をして、パスワードを聞かれたらパスワードを入力する。
そうすると、

2048 SHA256:ZUc......... /Users/username/.ssh/id_rsa (RSA)

このように表示されたら成功です。

configファイルを編集

最後に、

$ vim ~/.ssh/config

上記でconfigファイルの中を見て、

Host *
  ForwardAgent yes

を追加すると接続完了です。

0
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
0
0