Help us understand the problem. What is going on with this article?

特定のIPからのみSSH接続を許可

More than 3 years have passed since last update.

前にOpenVPNを構築して開発環境を作成したが、

SSH接続をOpenVPN経由でのみ許可したかったためその方法を紹介します。

1. /etc/hosts.denyに追加

初めに拒否リストを編集してすべての接続を拒否する

vi /etc/hosts.deny

#すべての接続を拒否
sshd : ALL

2. 許可するIPを/etc/hosts.allowに追加

次に許可したいIPをここに追加

vi /etc/hosts.allow

#接続を許可したいIPを追記
sshd: 10.8.
sshd: 127.0.0.1

これで/etc/hosts.allowに追加したIPからのみSSH接続ができるようになりました。

sims0728
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした