質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
CentOS

CentOSは、主にRed Hat Enterprise Linux(RHEL)をベースにした、フリーのソフトウェアオペレーティングシステムです。

FTP

FTP(File Transfer Protocol)は、ネットワークでのファイル転送を行うための通信プロトコルの1つである。

Q&A

解決済

1回答

1857閲覧

SFTP(OpenSSH)アップロードでのファイルタイプ制限

jcaky

総合スコア11

CentOS

CentOSは、主にRed Hat Enterprise Linux(RHEL)をベースにした、フリーのソフトウェアオペレーティングシステムです。

FTP

FTP(File Transfer Protocol)は、ネットワークでのファイル転送を行うための通信プロトコルの1つである。

0グッド

1クリップ

投稿2017/02/01 14:01

###前提・実現したいこと
CentOS7上でOpenSSHによるSFTPサーバを立てようとしています。
ここでアップロードするファイルタイプについて制限をかけたいのですが
Webで調べてもそのような設定が見つかりませんでした。

ファイルタイプ制限をかけるような設定をご存知の方がおられましたら
ご教示いただけませんでしょうか。

もしくは、OS側の設定で実現するなど、別の実現手法やアイディアでも構いませんので、ご教示いただけますと幸いです。

よろしくお願いいたします。

###試したこと
Web調査

###補足情報(言語/FW/ツール等のバージョンなど)
CentOS7.2
OpenSSH7.3p1

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

使用している FTP Server の設定になると思います。
例えば vsftpd であれば、 vsftpd.conf に deny_file の設定ができるはずです。

deny_file

This option can be used to set a pattern for filenames (and directory names etc.) which should not be accessible in any way. The affected items are not hidden, but any attempt to do anything to them (download, change into directory, affect something within directory etc.) will be denied. This option is very simple, and should not be used for serious access control - the filesystem's permissions should be used in preference. However, this option may be useful in certain virtual user setups. In particular aware that if a filename is accessible by a variety of names (perhaps due to symbolic links or hard links), then care must be taken to deny access to all the names. Access will be denied to items if their name contains the string given by hide_file, or if they match the regular expression specified by hide_file. Note that vsftpd's regular expression matching code is a simple implementation which is a subset of full regular expression functionality. Because of this, you will need to carefully and exhaustively test any application of this option. And you are recommended to use filesystem permissions for any important security policies due to their greater reliability. Supported regex syntax is any number of *, ? and unnested {,} operators. Regex matching is only supported on the last component of a path, e.g. a/b/? is supported but a/?/c is not. Example: deny_file={*.mp3,*.mov,.private}

例としてはこことかですかね。

投稿2017/02/02 00:00

tacsheaven

総合スコア13703

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

jcaky

2017/02/02 03:36

御回答ありがとうございます。今回はOpenSSHだけでSFTPサーバを作るつもりですが、御回答を今後の参考に致します。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問