1
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 1 year has passed since last update.

Windows10 ssh ポート22以外にしたときにConnection timed outが発生する

Last updated at Posted at 2023-10-26

デフォルトポートは使わない

sshはコンピュータを自由に操作できることから、セキュリティの関係上デフォルトのポートである22番はあまり使わない方が良いとされている。そこで、ポートを変更したいわけだが、ポートを変更したら、sshで接続しようとしたときにConnection timed outが発生するようになった。
ちなみに、pingしてみたけど、pingもつながらない。調べるとwindowsはpingに対して反応しないようにデフォルトで設定されていることが分かった。と、疎通確認をしようとしたわけだったが、設定をいじるのにVNCを使っていた。そのため、ネットワーク自体は絶対につながっている確信があった。よって、pingの設定はいじらなかった。そんなこんなで、解決に少しだけ時間がかかったので、備忘録として残しておく。

解決策

ゲストPC(sshサーバが動いている方のPC)のWindowsのファイヤーウォールの受信規則を設定したら、直った。

  1. Windowsキー+sで検索バーを開く
  2. 「Windows Defender ファイアウォール」と検索
  3. 受信の規則をクリック
    image.png
  4. 新しい規則をクリック
    image.png
  5. ポートをクリック
    image.png
  6. sshしたいポート番号を入力(例は1000の場合)
    image.png
  7. 以降の項目はお好みでよいと思います。
1
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
1
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?