3/24/17

Delete files older than 180 days in Linux

Sometimes you want to remove old files on a server.

Show all files older 180 days:

$ find . -mtime +180 -print

Delete all files older 180 days:

$ find . -mtime +180 -delete;

or

$ find . -mtime +180 -exec rm -f {} \;

3/22/17

FTP server install and config

vsftpd

sudo apt-get -y install vsftpd

nano /etc/vsftpd.conf
  • anonymous_enable=NO
  • local_enable=YES
  • write_enable=YES
  • chroot_local_user=YES
sudo service vsftpd restart
sudo chmod a-w /home/user/

proftpd

sudo apt install proftpd
nano /etc/proftpd/proftpd.conf 
  • RequireValidShell off 
  • AuthUserFile /etc/proftpd/ftpd.passwd 
  • DefaultRoot
cd /etc/proftpd

ftpasswd --passwd --name=ftp_upload --home=/var/www/upload --shell=/sbin/nologin --uid=48 --gid=48

service proftpd restart