Sys Admin

Apps

Resources


Backup

  • rsync: backup tool
  # a is for archive, v for verbose, h for human and p for partial
  rsync -avhp src/ dest/

Resources

Block connections on 22 port

Use the tool endlessh


FileSystem

Create swap memory

  • First, you need to create the file:
sudo dd if=/dev/zero of=/swapfile bs=1024 count=1000000
  • Then, format the swap file:
sudo mkswap /swapfile
  • After that, restrict the permission:
sudo chmod 600 /swapfile
  • Activate the swap:
sudo swapon /swapfile
  • (Optional) Depending if you need to have it online when you restart the computer, you need to edit /etc/fstab as follow:
# FS          mountpoint  type  option(s) dump pass
/path/to/swap    none     swap      sw      0    0

Resources


Firewall

Resources


Nginx

Resources

  • Proxy_pass: tutorial about nginx proxy_pass directive

SSH

Chroot jail

Definition

Use chroot jail wit SSH. It allows to isolate a user through ssh in a specific directory with limited commands.

Resources


VPN

Resources


Sudo & su

Su

  • Execute a command with the default shell for a specific user
    su <user> -c <command>
    
  • Execute a specific shell for a specific user
    su <user> -s <shell>