0
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 5 years have passed since last update.

メモ:SSHポート番号の変更

0
Posted at

経緯

-ラズパイのセキュリティ対策でSSHのポート番号を変更しようと考えた。
-ちょー基本でどハマりしたので、メモ。。。

最初

  • SSHの設定ファイルをいじるために
    sudo nano /etc/ssh/sshd_config
  • 先頭のPortを22から任意の番号に変更
  • Teratermからログインしようとしても、サーバーに拒絶されましたとなる。

調査

-ファイアウォール見直したり
−ルーターの設定なども見たけれど、変化なし
−諦めて、SSH自体を無効に、VNCで接続することに

オチ

-macからなら行けるかもと、再度SSHを有効にして、ログイン
ssh user@ipアドレス
 →ログインできる

ssh -p ポート番号 user@ipアドレス
 →ログインできない

ssh -p 22 user@ipアドレス
 →ログインできた

ーー>ポート番号の#コメントアウトを外すのを忘れていただけでした。。。

0
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
0
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?