Skip to content

Instantly share code, notes, and snippets.

@gerhardberger
Created March 4, 2016 00:02
Show Gist options
  • Save gerhardberger/4cb96ec836a98b5718e3 to your computer and use it in GitHub Desktop.
Save gerhardberger/4cb96ec836a98b5718e3 to your computer and use it in GitHub Desktop.
# 1.3
iptables -A INPUT --source 10.0.2.0/24 --protocol tcp --dport 22 -j ACCEPT
iptables -A INPUT --source 127.0.0.0/8 --protocol tcp --dport 22 -j ACCEPT
iptables -A INPUT --protocol tcp --dport 22 -j DROP
# 1.4
iptables -A INPUT --protocol icmp -j DROP
# 1.5
sudo adduser gellert
# 1.6
sudo usermod -a -G sudo gellert
# 1.7
vim /etc/ssh/sshd_config
# set `PermitRootLogin no`
/etc/init.d/ssh restart
# 2.1
apt-cache search apache2
apt-get install apache2
# 2.2
cat /etc/apache2/ports.conf | grep listen -i
netstat -anp | grep apache
# 2.3
# download https://github.com/ng201/iru
# /var/www/-be masolni
sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/irulabor.conf
# DocumentRoot /var/www/irulabor-master
# ServerName irulabor.vmware
# ServerAlias *.irulabor.vmware
# hosts
# 127.0.0.1 irulabor.vmware
a2ensite irulabor
/etc/init.d/apache2 restart
# 2.4
# /etc/apache2/sites-available/irulabor.conf-ba
# <Directory /var/www/irulabor/vedett>
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
# </Directory>
/etc/init.d/apache2 reload/restart
# 2.5
touch /home/gellert/.htpasswd
htpasswd /home/gellert/.htpasswd gellert
# conf-ba
<Directory /var/www/irulabor/vedett>
AllowOverride None
Order allow,deny
allow from all
AuthType Basic
AuthName "Vedett oldal fajl alapu autentikacioval"
AuthUserFile /home/gellert/.htpasswd
Require valid-user
</Directory>
/etc/init.d/apache2 reload/restart
# 2.6
sudo apt-get install libapache2-mod-authnz-external pwauth
sudo apt-get install libapache2-mod-authz-unixgroup
sudo a2enmod authnz_external authz_unixgroup
# conf-ba
<IfModule mod_authnz_external.c>
AddExternalAuth pwauth /usr/sbin/pwauth
SetExternalAuthMethod pwauth pipe
</IfModule>
<Directory /var/www/irulabor-master/nagyonvedett>
AllowOverride None
Order allow,deny
allow from all
AuthType Basic
AuthName "Restricted Area"
AuthBasicProvider external
AuthExternal pwauth
Require valid-user
</Directory>
# 2.8
# conf-ba
<Directory /var/www/irulabor/nyilvanos>
AllowOverride all
</Directory>
# 2.9
# nyilvanos/.htaccess-be
# kikommentelni a nyilvanos.html-est
Options +Indexes
# 4.1
# ...
rsync -zvr /home/backup/src /home/backup/src/bckup
# 4.2
# ...
rsync -auv /home/backup/src/bckup /home/backup/src
# 4.3
# ...
rsync -auv --delete /home/backup/src/bckup /home/backup/src
# 5.2
tar xvf monit_tar
# ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment