Operating System - HP-UX
1820096 Members
3567 Online
109608 Solutions
New Discussion юеВ

blocking specific file extensions with sftp

 
Brent DeGennaro
Regular Advisor

blocking specific file extensions with sftp

Is it possible to filter or block files with extensions like .mp3 with sftp? Looking for something similar to path-filter in ftpaccess.

Thanks
2 REPLIES 2
Steven E. Protter
Exalted Contributor

Re: blocking specific file extensions with sftp

Shalom,

These products were not designed to filer files. sftp is part of openssh and the name is kind of meaningful.

Even if you succeed in blocking mp3 files people will just rename them and transfer them anyway.

This is a job for content filtering and a strong HR Internet use policy.

You can write a cron job to scan for and delete these files

find /directoy -name *.mp3 > list
while read -r fn
do
rm -f $fn
done < list

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
VK2COT
Honored Contributor

Re: blocking specific file extensions with sftp

Hello,

If you are prepared to use more
comprehensive FTP over SSL server
like ProFTPD, then you can do it.

proftpd.conf has options like:

PathDenyFilter "\\.(jpg|jpgeg|mpeg|mpg|mp3)$"

There is a module that is distributed with
ProFTPD to support SSL/TLS:

You may need to specify the location of the OpenSSL header and library files in your configure command. For example:

./configure --with-modules=mod_tls \
--with-includes=/usr/local/openssl \
--with-libraries=/usr/local/openssl

If memory serves me well, there is a
port with TLS/SSL to HP-UX somewhere.

The Porting and Archiving Centre for HP-UX
contains only standard ProFTPD...

Cheers,

VK2COT
VK2COT - Dusan Baljevic