Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sshでgithubへの接続でpermission denied (publickey) #3

Closed
terakawa-0707 opened this issue Aug 20, 2011 · 3 comments
Closed

sshでgithubへの接続でpermission denied (publickey) #3

terakawa-0707 opened this issue Aug 20, 2011 · 3 comments

Comments

@terakawa-0707
Copy link
Collaborator

sshの秘密鍵、公開鍵を作って、公開鍵をgithubに登録。
 → ターミナルからgithubへsshしてみたが、permission denied (publickey)が発生。

手順
 1.ssh-keygen -t rsa -C "メールアドレス"    公開鍵を作成
   → $HOME/.ssh/id_rsaと、id_rsa.pub が作られている事を確認
 2.pbcopy < ~/.ssh/id_rsa.pub   公開鍵をクリップボートにコピー
   →githubのprofileの変更から、公開鍵を登録
 3.ssh -T [githubアカウント]@github.com
   →Permission denied (publickey).
 公開鍵を指定しても同じでした
   → ssh -i .ssh/id_rsa -T [githubアカウント]@github.com

 いろいろやってみたけど、うまくいかず。 LIONにしたから?

@ygr
Copy link
Owner

ygr commented Aug 21, 2011

githubはあくまでgitリポジトリを提供するサービスのため、sshで接続してshellの実行はできません。
接続を確認するという意味でしたら

ssh git@github.com

で確認できます。

参考URL:
http://use-git-tower.posterous.com/github
http://blog.katsuma.tv/2009/02/first_github.html

@terakawa-0707
Copy link
Collaborator Author

 参考URLと、同じ手順で作成しているはずなんですが。

 'successfully authenticated' が出ないんですよね。

 違いとしては、ssh に-Tオプションがあるかないかぐらい。帰ったら、再度、確認してみます。

@terakawa-0707
Copy link
Collaborator Author

とりえず、できました。
$ ssh -T [githubアカウント]@github.com
ではなく
$ ssh -T git@github.com
でした。自分のgithubアカウントじゃないんだね。接続に成功すると以下が表示されます
Identity added: /Users/tera/.ssh/id_rsa (/Users/tera/.ssh/id_rsa)
Hi terakawa-0707! You've successfully authenticated, but GitHub does not provide shell access.

一応、他にやった事
 chmod 600 .ssh/id_rsa.pub
 ssh-add

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants