ssh 111.111.111.111 -l root
sudo /usr/sbin/groupadd wheel
sudo vim /etc/sudoers
Allows people in group wheel to run all commands
%sudo ALL=(ALL) ALL
%wheel ALL=(ALL) NOPASSWD:ALL
/usr/sbin/adduser bob
/usr/sbin/usermod -a -G wheel demo
mkdir ~/.ssh
ssh-keygen -t rsa
scp ~/.ssh/id_rsa.pub [email protected]:
mv ~/id_rsa.pub ~/.ssh/authorized_keys
chown -R bob:bob ~/.ssh
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
sudo vim /etc/ssh/sshd_config
Protocol 2
UsePrivilegeSeparation yes
PermitRootLogin no
StrictModes yes
RSAAuthentication yes
PubkeyAuthentication yes
PermitEmptyPasswords no
ChallengeResponseAuthentication no
PasswordAuthentication no
UsePAM no
sudo vim /etc/iptables.up.rules
*filter
-A INPUT -i lo -j ACCEPT
-A INPUT -d 127.0.0.0/255.0.0.0 ! -i lo -j REJECT --reject-with icmp-port-unreachable
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
-A INPUT -m limit --limit 5/min -j LOG --log-prefix "iptables denied: " --log-level 7
-A INPUT -p tcp -m tcp --dport 3690 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-port-unreachable
-A FORWARD -j REJECT --reject-with icmp-port-unreachable
-A OUTPUT -j ACCEPT
COMMIT
/sbin/iptables-restore < /etc/iptables.up.rules
sudo vim /etc/network/if-pre-up.d/iptables
#!/bin/sh
/sbin/iptables-restore < /etc/iptables.up.rules
sudo chmod +x /etc/network/if-pre-up.d/iptables
sudo /etc/init.d/ssh reload
sudo /usr/sbin/locale-gen en_US.UTF-8
sudo /usr/sbin/update-locale LANG=en_US.UTF-8
sudo aptitude update
sudo aptitude safe-upgrade
sudo aptitude install build-essential
dpkg-reconfigure tzdata