2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Sourcetree経由でGithubに登録したSSHキーで組織下のリポジトリにアクセスできない

Posted at

環境

macOS Catalina
10.15.4

課題

SourceTree使ってて、Github Organization以下のリポジトリをクローンしようとしてリポジトリが無いと言われる。

& git clone git@github.com:ruby-inc/hogehoge
Cloning into 'hogehoge'...
ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

一応SSHキーを確認する

ssh -T git@github.com
Hi fukmaru! You've successfully authenticated, but GitHub does not provide shell access.

パーソナルのリポジトリであれば、クローンできる。なんでー :sob:

解決方法

ssh-keygen から再度作成して、ssh 🔑 の登録。

原因

このSSHキーはSourcetreeで、作成して登録していて、OAuth Appのアクセス制限により制限がかかっていて、パーソナルなリポジトリ(NOT Organization下のリポジトリ)のみアクセスできるように制限がかかっていた。(どういった条件でこれが発動するのかわからない・・・調査不足ですみません)

https://help.github.com/ja/github/creating-cloning-and-archiving-repositories/error-repository-not-found

リポジトリが Organization に属し、OAuth App によって生成された SSH キーを使用している場合、OAuth App へのアクセスは Organization のオーナーによって制限されている可能性があります。 詳しい情報については、「OAuth App のアクセス制限について」を参照してください。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?