Skip to content

Instantly share code, notes, and snippets.

@bluPhy
Last active June 27, 2024 19:14
Show Gist options
  • Save bluPhy/017364d82b064c9b77c57ee9f061de66 to your computer and use it in GitHub Desktop.
Save bluPhy/017364d82b064c9b77c57ee9f061de66 to your computer and use it in GitHub Desktop.
###################################################################
# This is not require anymore, use the official script from: #
# https://gitlab.com/parrotsec/project/debian-conversion-script #
###################################################################
#!/bin/bash -v
# This prevents the installer from opening dialog boxes during the installation process. As a result, it stops the errors from displaying
# export DEBIAN_FRONTEND=noninteractive
### Adding default user
while true; do
read -p "Provide the password for default username (user):" -s -r password
if [[ $password =~ ^(?=.*[0-9])(?=.*[A-Z])(?=.*[a-z]).{8,}$ ]]; then
# Password meets all conditions
break
else
echo "Error: Password must be at least 8 characters long and contain at least one digit, one uppercase letter, and one lowercase letter."
fi
done
password_salt=$(openssl rand -base64 12)
password_hash=$(openssl passwd -6 -salt "$password_salt" "$password")
sudo useradd --create-home user --home "/home/user" --password "$password_hash" --shell "/bin/bash" --groups sudo
### Install needed packages
sudo apt update
### Installing tzdata and assuming UTC to avoid getting prompted
sudo DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends tzdata debconf-utils keyboard-configuration
### Installing mate and lightdm as they have less issues with xrdp
sudo DEBIAN_FRONTEND=noninteractive apt install -y git bash-completion wget gnupg dirmngr software-properties-common busybox xrdp lightdm task-xfce-desktop
### Cloning and running parrot-install as per https://github.com/ditohd/parrotfromdebian
git clone https://github.com/ditohd/parrotfromdebian.git
cd ~/parrotfromdebian || { echo "Error could not get into the folder"; exit 1; }
sudo bash ~/parrotfromdebian/parrotfromdebian.sh
### Update packages ###
sudo apt update
sudo apt -y upgrade
sudo apt -y dist-upgrade --force-yes --fix-broken
sudo apt -y install spice-vdagent
### Clean up ###
sudo apt -y autoremove --purge
sudo apt clean
echo Done.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment