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

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

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

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

Q&A

2回答

6354閲覧

XserverでSSH接続ができない。 エラー Permission denied Received disconnect

doraemon

総合スコア8

SSH

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

0グッド

0クリップ

投稿2016/10/12 06:42

編集2022/01/12 10:55

###前提・実現したいこと
XserverでSSH接続

###発生している問題・エラーメッセージ
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

以下はなくなりました
Received disconnect from ...: 2: Too many authentication failures for id

エラーメッセージ Permission denied (publickey,gssapi-keyex,gssapi-with-mic). 以下はなくなりました Received disconnect from ...: 2: Too many authentication failures for id
デバッグ OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011 debug1: Reading configuration data /etc/ssh_config debug1: /etc/ssh_config line 20: Applying options for * debug1: /etc/ssh_config line 102: Applying options for * debug1: Connecting to id.xserver.jp [...] port 10022. debug1: Connection established. debug1: identity file /Home/.ssh/id_rsa type 1 debug1: identity file /Home/.ssh/id_rsa-cert type -1 debug1: identity file /Home/.ssh/id_dsa type -1 debug1: identity file /Home/.ssh/id_dsa-cert type -1 debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_6.2 debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1 debug1: match: OpenSSH_6.6.1 pat OpenSSH* debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: server->client aes128-ctr hmac-md5-etm@openssh.com none debug1: kex: client->server aes128-ctr hmac-md5-etm@openssh.com none debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP debug1: SSH2_MSG_KEX_DH_GEX_INIT sent debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY debug1: Server host key: RSA debug1: Host '[id.xserver.jp]:10022' is known and matches the RSA host key. debug1: Found key in /Home/.ssh/known_hosts:1 debug1: ssh_rsa_verify: signature correct debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: SSH2_MSG_SERVICE_REQUEST sent debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic debug1: Next authentication method: publickey debug1: Offering RSA public key: /Home/.ssh/id_rsa debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic debug1: Offering RSA public key: /Home/.ssh/id_rsa debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic debug1: Offering RSA public key: /Home/.ssh/id_rsa debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic debug1: Offering RSA public key: /Home/.ssh/id_rsa debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic debug1: Offering RSA public key: /Home/.ssh/id_rsa debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic debug1: Offering RSA public key: /Home/.ssh/id_rsa Received disconnect from ...: 2: Too many authentication failures for id
追記 デバッグ ssh-add -D 使用後 OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011 debug1: Reading configuration data /etc/ssh_config debug1: /etc/ssh_config line 20: Applying options for * debug1: /etc/ssh_config line 102: Applying options for * debug1: Connecting to id.xserver.jp [...] port 10022. debug1: Connection established. debug1: identity file /home/.ssh/id_rsa type 1 debug1: identity file /home/.ssh/id_rsa-cert type -1 debug1: identity file /home/.ssh/id_dsa type -1 debug1: identity file /home/.ssh/id_dsa-cert type -1 debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_6.2 debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1 debug1: match: OpenSSH_6.6.1 pat OpenSSH* debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: server->client aes128-ctr hmac-md5-etm@openssh.com none debug1: kex: client->server aes128-ctr hmac-md5-etm@openssh.com none debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP debug1: SSH2_MSG_KEX_DH_GEX_INIT sent debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY debug1: Server host key: RSA debug1: checking without port identifier The authenticity of host '[id.xserver.jp]:10022 ([...]:10022)' can't be established. RSA key fingerprint is . Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '[id.xserver.jp]:10022,[...]:10022' (RSA) to the list of known hosts. debug1: ssh_rsa_verify: signature correct debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: SSH2_MSG_SERVICE_REQUEST sent debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic debug1: Next authentication method: publickey debug1: Offering RSA public key: /home/.ssh/id_rsa debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic debug1: Trying private key: /home/.ssh/id_dsa debug1: No more authentication methods to try. Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

*IDなど個人情報のため一部改変しています。

###試したこと
1、rm -r ~/.ssh
2、mkdir ~/.ssh
3、ssh-keygen -t rsa
4、chmod 700 ~/.ssh
5、chmod 600 ~/.ssh/id_rsa
6、pbcopy < ~/.ssh/id_rsa.pub
7、Xserver内のSSH設定の公開鍵設定・登録に貼り付けて登録
8、ssh -l id -p 10022 id.xserver.jp -v

*ssh -l id -p 10022 id.xserver.jp -o PreferredAuthentications=pass
*で試した時はPermission denied (publickey,gssapi-keyex,gssapi-with-mic).になります。

*またXserverより公開鍵を生成した場合も同様のエラーが出ます。

追記
ssh-add -Dを実行後、再度上記手順を試しました

###補足情報(言語/FW/ツール等のバージョンなど)
Xserver
OpenSSH_6.2p2
OSSLShim 0.9.8r
MacBook Air 2012
標準ターミナル

複数のサイトの方法にて何度も試しましたがうまくいきませんので
わかる方がいましたらどうかよろしくお願いいたします。

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

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

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

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

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

guest

回答2

0

登録している鍵の数が多くて、サーバサイドのMaxAuthTriesの数を超えているようにみえます。

以下、参考になりませんか。
http://tkuchiki.hatenablog.com/entry/2013/02/20/104609

投稿2016/10/12 13:27

moonphase

総合スコア6621

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

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

doraemon

2016/10/13 10:13

ご回答ありがとうございます。 以下を参考にssh-add -Dを実行したところエラーが一つ解決しました。 http://tkuchiki.hatenablog.com/entry/2013/02/20/104609 まだ接続はできていないため再度デバッグ情報を質問に追記しましたのでよろしければご回答お願い致します。
moonphase

2016/10/14 00:28

念のためですがローカルのホームディレクトリのパーミッションはどうなっていますか? ls -ld $HOME $HOME/.sshが700でも、$HOMEが770だったりするとログイン出来ない場合があります。 その場合 chmod 700 $HOME してあげてください。 あと、デバッグレベルをもう少しあげてみてもらえますか?
doraemon

2016/10/14 10:13

moonphase様 返信いただきありがとうございます。 $HOMEが755だったため chmod 700 $HOME を行いました。 現在のホームディレクトリのパーミッションは以下になっています。 drwx------+ 74 name staff 2516 Oct 13 19:01 /Home/ 下記サイトを元にデバッグレベルをINFOからDEBUG3に変更いたしましたが 前回と情報が変わりませんでしたやり方が間違っているのでしょうか? http://qiita.com/pekepek/items/f38004b14e986691f30d エラーの内容は変わらず Permission denied (publickey,gssapi-keyex,gssapi-with-mic). のままです。
moonphase

2016/11/04 01:05

なんでしょうねぇ・・・ 秘密鍵ファイルも明示的に指定してみてはいかがでしょうか? ssh -i ~/.ssh/id_rsa -l id -p 10022 id.xserver.jp
guest

0

The authenticity of host '[id.xserver.jp]:10022 ([...]:10022)' can't be established.

このメッセージが表示されてるのでsshで使用してるポートを/etc/ssh/sshd_configもしくは、
lsof -i:10022コマンド(sshdが10022番ポートを使用してるか)で確認されてはいかがでしょうか?

投稿2016/11/03 10:55

pond

総合スコア350

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

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

ただいまの回答率
85.50%

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

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

質問する

関連した質問