質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
SSH

SSH(Secure Shell)は、セキュアチャネルを通してデータを交換するためのネットワークプロトコルです。リモートサーバーへのコマンド実行やファイル転送を行う時に一般的に使用されます。

GitLab

GitLabは Gitoliteをブラウザから管理できるようにする Rubyアプリケーションで、 GitHubのようなサービスをクローズドな環境に独自で構築できるように 公開されたものです。

Q&A

解決済

1回答

4893閲覧

gitLabにSSHできない

hayashisan

総合スコア1

SSH

SSH(Secure Shell)は、セキュアチャネルを通してデータを交換するためのネットワークプロトコルです。リモートサーバーへのコマンド実行やファイル転送を行う時に一般的に使用されます。

GitLab

GitLabは Gitoliteをブラウザから管理できるようにする Rubyアプリケーションで、 GitHubのようなサービスをクローズドな環境に独自で構築できるように 公開されたものです。

0グッド

0クリップ

投稿2020/08/16 19:20

編集2020/08/16 21:48

GitLabへのSSH

GitLabからgit cloneしたいのですが、そもそもSSHが繋がりません。
GitHabならよく使っていて流れ的に大差ないだろうと思っていたのですが・・。
権限はDeveloperです。
鍵に改行なども入っていなく、作り直しもしたのですがうまくいかず。

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

ssh -vvvT git@gitlab.com で以下が表示されました。 OpenSSH_8.1p1, LibreSSL 2.7.3 debug1: Reading configuration data /Users/******/.ssh/config debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 47: Applying options for * debug1: Connecting to gitlab.com port 22. debug1: Connection established. ・ ・ ・ debug2: languages stoc: debug2: first_kex_follows 0 debug2: reserved 0 debug1: kex: algorithm: curve25519-sha256@libssh.org debug1: kex: host key algorithm: ecdsa-sha2-nistp256 debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none debug3: send packet: type 30 debug1: expecting SSH2_MSG_KEX_ECDH_REPLY debug3: receive packet: type 31 debug1: Server host key: ecdsa-sha2-nistp256 SHA256:HbW3g8zUjNSksFbqTiUWPWg2Bq1x8xdGUrliXFzSnUw debug3: hostkeys_foreach: reading file "/Users/*******/.ssh/known_hosts" debug3: record_hostkey: found key type ECDSA in file /Users/*******/.ssh/known_hosts:1 debug3: load_hostkeys: loaded 1 keys from gitlab.com debug3: hostkeys_foreach: reading file "/Users/*******/.ssh/known_hosts" debug3: record_hostkey: found key type ECDSA in file /Users/*******/.ssh/known_hosts:1 debug3: load_hostkeys: loaded 1 keys from 2606:4700:90:0:f22e:fbec:5bed:a9b9 debug1: Host 'gitlab.com' is known and matches the ECDSA host key. debug1: Found key in /Users/*******/.ssh/known_hosts:1 debug3: send packet: type 21 debug2: set_newkeys: mode 1 debug1: rekey out after 134217728 blocks debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug3: receive packet: type 21 debug1: SSH2_MSG_NEWKEYS received debug2: set_newkeys: mode 0 debug1: rekey in after 134217728 blocks debug1: Will attempt key: /Users/*******/.ssh/rsa_gitlab RSA SHA256:kTgturZywmb42GbC0M5uHUQFGJGuqA/cOyZG69d3FwM explicit agent debug2: pubkey_prepare: done debug3: send packet: type 5 debug3: receive packet: type 7 debug1: SSH2_MSG_EXT_INFO received debug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-256,rsa-sha2-512> debug3: receive packet: type 6 debug2: service_accept: ssh-userauth debug1: SSH2_MSG_SERVICE_ACCEPT received debug3: send packet: type 50 debug3: receive packet: type 51 debug1: Authentications that can continue: publickey debug3: start over, passed a different list publickey debug3: preferred publickey,keyboard-interactive,password debug3: authmethod_lookup publickey debug3: remaining preferred: keyboard-interactive,password debug3: authmethod_is_enabled publickey debug1: Next authentication method: publickey debug1: Offering public key: /Users/*******/.ssh/rsa_gitlab RSA SHA256:kTgturZywmb42GbC0M5uHUQFGJGuqA/cOyZG69d3FwM explicit agent debug3: send packet: type 50 debug2: we sent a publickey packet, wait for reply debug3: receive packet: type 51 debug1: Authentications that can continue: publickey debug2: we did not send a packet, disable method debug1: No more authentication methods to try. git@gitlab.com: Permission denied (publickey).

該当のソースコード

key path /.ssh/rsa_gitlab /.ssh/config --- Host gitlab.com User git HostName gitlab.com IdentityFile ~/.ssh/rsa_gitlab

試したこと

keyの生成&gitlabへ登録
権限を600にする
/.ssh/config作成
Gitのグローバル設定

gitlabで他アカウントを作り同じ鍵で試すと問題なく接続できました
先方が作成したアカウントがDeveloperだから接続できないのか
権限で制限しているのか・・作成したばかりのプロジェクトなので
まだリポジトリすらありません。それ故にcloneもできないのかと考え中です。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

Permission denied (publickey).

ってのは、接続鍵が間違ってるときに出るエラーです

投稿2020/08/16 23:23

y_waiwai

総合スコア87774

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問