0
2

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.

SSH接続で許可するIPを指定する設定

Posted at

サーバに接続すると下記のメッセージが。。

「最後の正しいログインの後に xxx 回の失敗ログインの試行があります」

私の場合、6万回とかいってたので怖くなりすぐにセキュリティを見直すことに。

IPアドレス指定許可

特定のIPの接続を許可する

hosts.allowファイルを編集する

$vi /etc/hosts.allow

元の記載

all: 127.0.0.1

追記した内容

sshd: xxx.xx.x.xx

IPアドレス拒否

許可したIP以外からの接続を拒否する

hosts.denyファイルを編集する

$vi /etc/hosts.deny

元の記載

all: all

追記した内容

sshd: ALL


これで一応解決。ログイン失敗のメッセージも表示されなくなった。一安心。

参考サイト

グローバルIPアドレス指定時
hosts.allowファイル、hosts.denyファイルってなんぞや

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?