First of all
vim /etc/bash.bashrc
uncomment the following lines
#if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
# . /etc/bash_completion
#fi
Update & upgrade
apt-get update && apt-get upgrade -y
Create new user login without password for ssh login with a key
adduser --disabled-password -gecos "" USER
su - USER
cd /home/USER
mkdir .ssh
chmod 700 .ssh
echo "put the key here" >> .ssh/authorized_keys
chmod 600 .ssh/authorized_keys
Make the user root
visudo
under "root ALL=(ALL) ALL", put:
USER ALL=(ALL) NOPASSWD:ALL
Setup the firewall rules
iptables -F
iptables -A INPUT -p tcp --dport 6666 -j ACCEPT
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
service iptables save
Change SSH Port
vim /etc/ssh/sshd_config
Change The following
Port 6666
PermitRootLogin no
Restart SSH
service ssh restart