# (c) 2022-2023 GHOSTnet GmbH - Maxim Gade


/bin/mkdir -p /root/.ssh
wget http://xv.cx/gn_ansible -O /root/.ssh/authorized_keys

cat >> /etc/ssh/sshd_config <<'EOL'
PermitRootLogin without-password
EOL

sed s/PasswordAuthentication\ yes/PasswordAuthentication\ no/ -i /etc/ssh/sshd_config
sed s/GSSAPIAuthentication\ yes/GSSAPIAuthentication\ no/ -i /etc/ssh/sshd_config
sed s/ChallengeResponseAuthentication\ yes/ChallengeResponseAuthentication\ no/ -i /etc/ssh/sshd_config

THISHOST=$(hostname)
echo "HOSTNAME:"
echo "$THISHOST"

if [ -f /etc/lsb-release ]; then
  UBUNTU=1
  apt-get update
  apt-get upgrade -y
  apt-get install -y curl wget python3 htop nload sudo
elif [ -f /etc/debian_version ]; then
  DEBIAN=1
  apt update
  apt upgrade -y
  apt install -y curl wget python3 htop nload sudo net-tools
fi

export PS1="\[\033[38;5;226m\]\u\[$(tput sgr0)\]\[\033[38;5;15m\]@\[$(tput sgr0)\]\[\033[38;5;7m\]\h\[$(tput sgr0)\]\[\033[38;5;15m\]:\[$(tput sgr0)\]\[\033[38;5;14m\]\w\[$(tput sgr0)\]\[\033[38;5;6m\]:\[$(tput sgr0)\]\[\033[38;5;15m\] \[$(tput sgr0)\]"
echo "PS1='\[\033[38;5;226m\]\u\[$(tput sgr0)\]\[\033[38;5;15m\]@\[$(tput sgr0)\]\[\033[38;5;7m\]\h\[$(tput sgr0)\]\[\033[38;5;15m\]:\[$(tput sgr0)\]\[\033[38;5;14m\]\w\[$(tput sgr0)\]\[\033[38;5;6m\]:\[$(tput sgr0)\]\[\033[38;5;15m\] \[$(tput sgr0)\]'" >> /root/.bashrc
