Linuxサーバーを立てたらまず最初にSSHのポート変更は行ったほうが良いでしょう
SSHのポートはデフォルトで22になっているので、世界中に22番ポートを探して回っているようなロボットがあります。
(Linuxで対策の甘いサーバーを探して乗っ取るのが目的だと思いますが)
下記のような方法でSSHポートを変えましょう。
# cd /etc/ssh
# vi sshd_config
変更する番号は利用されていないポートにしましょう。
予め予約されているポート番号をウェルノンポートといいます。
下記のページで予約されているポート番号がわかります。
Service Name and Transport Protocol Port Number Registry
下記の#port 22を探して下さい。
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options change a
# default value.
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options change a
# default value.
#Port 22
#Protocol 2,1
Protocol 2
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
「i」でINSERTモードにします。
#Port 22
の下に
Port ******
※*は自分で変更したいポート番号
と入力します。
また、
#ListenAddress 0.0.0.0 の頭の#を削除します。
※保存は[Esc] + [:wq]
終わったらSSHを再起動します
/etc/rc.d/init.d/sshd restart
人気記事一覧
- MySQL 最大の値・最新の日付データを1つ抽出する方法(MAX)
- [CakePHP] XformHelperの使い方
- Linux: スワップファイル(swp)の削除方法
- HTMLのForm methodとactionについて
- PHPでカンマ区切りデータを配列に入れる方法 (explode)
- [エラー対処] failed to open stream: No such file or directory
- [CSS]ブロック要素(div)の高さを、内部のfloat要素に合わせて自動調整する
- [vsftp] FileZillaから接続できない場合の対処法
- PHP5.1→PHP5.3へバージョンアップする方法(CentOS)
- PHPでテキストを1行ずつ読み込む方法(file_get_contents,explode)