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.

WebStormでキーペアを使ったSFTPができない問題の対策

Posted at

はじめに

最近、VSCodeからIntelliJ系WebStormに乗り換えました。というか乗り換え中。
SFTPでwebサーバにデプロイしようとしたところ、そもそもSSH接続がうまくいかない問題が発生して悩んでいたんですが、ようやく解決したので書いておきたいと思います。

発生した問題

環境

Windows 10
WebStorm 2021.3.3

問題の詳細

とにかくキーペアを使ったSSH接続(いわゆる鍵認証)ができない。
パスフレーズの有無は関係なかった。

ちなみに、同じPC上の他のアプリ(VSCode, RLogin)からは接続できていた。

SSH設定から接続情報を登録し、「接続のテスト」ボタンを押すと

リモートホストに接続できません

と表示される。

ログ

ログはこれだけ。エラー的なものは見当たらなかった。
※ ヘルプ>診断ツール>デバッグログ設定 で#com.intellij.sshを追加してから実行した。

INFO - om.intellij.ssh.impl.sshj.sshj - Client identity string: SSH-2.0-IntelliJ__WebStorm_WS-213.7172.31__SSHJ_0.32.1_SNAPSHOT 
INFO - om.intellij.ssh.impl.sshj.sshj - Will treat the identification of this server 'SSH-2.0-OpenSSH_4.3' leniently 
INFO - om.intellij.ssh.impl.sshj.sshj - Server identity string: SSH-2.0-OpenSSH_4.3 
INFO - om.intellij.ssh.impl.sshj.sshj - Disconnected - BY_APPLICATION 

対処法

SSH構成ファイルを作成して、HostKeyAlgorithmsを設定した。

  • C:\Users\自分のユーザ名\.sshconfigファイルを作成して以下を記述する。
HostKeyAlgorithms ssh-rsa
  • WebStormのSSH設定で、「構成ファイル ~/.ssh/configの構文解析」にチェックを入れる。

以上!

参考

※WebStormに限った話ではないっぽい。 PHPStormでの問題報告が多い。

おわりに

コピーミスとか鍵指定ミスかと思って、めちゃくちゃ何度もコピペしたり指定し直したりしてたので、悲しくなりました。

実はこれが初投稿です。生暖かく見守っていただけると嬉しいです。

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?