LoginSignup
0
0

More than 1 year has passed since last update.

.sshフォルダのアクセス権限が終わってたので無理やりgit cloneする

Last updated at Posted at 2022-04-22

環境

Windows10

原因

.sshのファルダの権限が,744になっていた.そのためSSHするときに以下のエラーが出た.

Permission denied (publickey,gssapi-keyex,gssapi-with-mic)

Windowsだったため権限の変更が分からなかったため(ICACLSがどちゃくそ面倒そうだった)試行錯誤してSSHする.

解決手段

試しにSSHでオプションで秘密鍵を指定してログインしたところ成功した.
ssh -i ~/.ssh/秘密鍵 user@y.y.y.y

なのでgit cloneする時に秘密鍵を指定しました.指定する方法として2つある.

  1. 永続的に指定する方法がgit config core.sshCommandで指定する.
$ git config core.sshCommand="ssh -i ~/.ssh/id_rsa_example" clone (clone先) (保存する場所)  
  1. 一時的に秘密鍵を指定する方法がgit -c core.sshCommandで指定する.
$ git -c core.sshCommand="ssh -i ~/.ssh/id_rsa_example" clone (clone先) (保存する場所)  
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