Daily Archives: 18.05.2016

Testing if a server port is actually open

There are actually a whole lot of possibilities to do that, the most simple one probably to use a simple telnet: telnet example.net 80 Or the good old nmap: nmap -sS -O -p80 example.net In a Bash script you can simple do it this way: #!/bin/bash test=$(nc -z -v -w1 example.net 80 2>&1) if [[ $test == Connection*succeeded* […]

Using VirtualHosts on a ProFTPd server

When using ProFTPd you may want to have the server listening on different ports, for example if you want to use FTP and SFTP at the same time. Here is an example: <VirtualHost ftp.example.net> SFTPEngine off Port 21 DefaultRoot ~ Umask 022 022 AllowOverwrite on </VirtualHost> <VirtualHost sftp.example.net> SFTPEngine on Port 2222 SFTPLog […]

Installing ProFTPd with Public Key Authentication on Ubuntu 16.04

First install proftpd: apt-get update apt-get install proftpd Next, change the following lines in /etc/proftpd/proftpd.conf: ServerName "sftp.example.net" DefaultRoot ~ Put in your hostname (if it resolves) or IP address as ServerName. The second line will jail the user to his home directory. Next, create the file /etc/proftpd/conf.d/sftp.conf with the following content: <IfModule mod_sftp.c> SFTPEngine on # If […]