LoginSignup
0
0

More than 5 years have passed since last update.

SourceTreeのクローン時にPermission denied (publickey,gssapi-keyex,gssapi-with-mic,password)が発生する

Last updated at Posted at 2018-06-15

前提・実現したいこと

SSH接続にてロリポップのリモート環境で作業を行い、リモートリポジトリを作成しました。
その後、ローカル環境にてGit Cloneを実行した時に以下のようなエラーメッセージが発生しました。
※ただしSourceTreeのみで操作している時のみ発生し、ターミナルで操作する際は通常通りGit Cloneが実行できる。

リポジトリをクローンする際の、ソースURLには、以下を入力している
ssh://SSHアカウント@SSHサーバー:2222リモートリポジトリ(bareリポジトリ)のフルパス
参考:https://lolipop.jp/manual/other/git/

発生している問題・エラーメッセージ

Please make sure you have the correct access rights
and the repository exists.
Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
fatal: Could not read from remote repository.

試したこと

こちらを参考に再度SSHキーを作成し、GitHub、GitBucketに登録しましたが、同様のエラーが発生しました。
http://tuki0918.hatenablog.com/entry/2013/05/26/143744

解決方法

ssh-askpassインストール

Homebrewを使ってssh-askpassをインストール

brew tap theseal/ssh-askpass
brew install ssh-askpass

SSH keyを読み込む

コマンドは以下の通り:

ssh-add -l

パブリックキーをホストにアップロードする

  1. ローカル環境で ~/.ssh/id_rsa.pub のファイルの中身をコピーする
  2. ホスト/サーバー環境で .ssh配下に authorized_keys ファイルを配置する こんな感じ /var/www/vhosts/example.com/.ssh/authorized_keys

参考

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