Homebrewインストールインストール時に時に以下のようなエラーが出ました。
==> Checking for `sudo` access (which may request your password)... Password: Sorry, try again. Password: ==> This script will install: /usr/local/bin/brew /usr/local/share/doc/homebrew /usr/local/share/man/man1/brew.1 /usr/local/share/zsh/site-functions/_brew /usr/local/etc/bash_completion.d/brew /usr/local/Homebrew Press RETURN to continue or any other key to abort: ==> /usr/bin/sudo /usr/sbin/chown -R Tsuyumi:admin /usr/local/Homebrew ==> Downloading and installing Homebrew... Tsuyumi@github.com: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. Failed during: git fetch --force origin
GitHubにてSSH接続設定が出来ていないことが原因でした。
GitHub 登録時にSSH接続で設定していたので、なぜアクセスできないかは、わからなかったのですが、鍵が発行されているか、configに詳細が記されているか確認後、ssh接続は以下のように出来ました。
ssh
1Hi tsuyumi-s! You've successfully authenticated, but GitHub does not provide shell access.
しかし、その後Homebrewのインストールを2-3回行いましたが一向に上手くいかず、毎度Permission deniedが表示されます。
同じエラーのご経験のある方、ご教示願います。
再度インストールを試みたところ、以下のようなエラーがでました。
Failed during: git fetch --force origin
homebrew のインストール時に git fetch するのは github の public repository なので、そもそも ssh 接続の設定自体が不要なはずですが、もしかして https な URL でも常に ssh 接続するような git の設定してたりしますか?
gitの処理でパスワード等の入力が不要になるので設定していたのですが、不要なんですね…
もしかしたら設定してしまっているのかもしれません。
そのgitの設定はどちらで確認できるか教えていただけますでしょうか…(><)
たぶん ~/.gitconfig あたりに書いてあると思いますが、普通は git config コマンドで読み書きします。
というか、「ssh 接続の設定自体が不要なはず」と書いたのはあくまで homebrew の話で、普通に github のリポジトリに push とかする場合には必要でしょうね。でも、エラーが出るってことは、そもそも認証に失敗してるのでは…。
すでに回答がついてるので、そちらも参考にしてください。
回答2件
あなたの回答
tips
プレビュー