diff --git a/setup.sh b/setup.sh index 1e8fcb0..d9384d5 100644 --- a/setup.sh +++ b/setup.sh @@ -12,7 +12,7 @@ init() { echo "Starting initialization" echo $hostname > /etc/hostname - sed -i -e "s/=default_hostname/$fqdn $hostname/g" /etc/hosts + sed -i -e "s/$default_hostname/$fqdn $hostname/g" /etc/hosts localectl set-keymap $keymap timedatectl set-timezone $timezone systemctl disable apt-daily-upgrade.timer @@ -23,7 +23,7 @@ install_packages() { sed -i -e "s/$deb_apt_default_repo/$deb_apt_repo/g" /etc/apt/sources.list apt update apt upgrade -y - apt install -y vim tree tmux neofetch + apt install -y vim tree tmux neofetch vsftpd cryptsetup } add_users() { @@ -68,6 +68,14 @@ ssh_pubkey() { sudo -H -u $user mv /home/$user/.ssh/$remote_pubkey /home/$user/.ssh/authorized_keys } +set_vsftpd() { + echo "Setting vsftpd config" + sed -i -e "s/#write_enable=YES/write_enable=YES/g" /etc/vsftpd.conf + sed -i -e "s/#utf8_filesystem=YES/utf8_filesystem=YES/g" /etc/vsftpd.conf + sed -i -e "s/ssl_enable=NO/ssl_enable=YES/g" /etc/vsftpd.conf + openssl req -x509 -nodes -days 7300 -newkey rsa:2048 -keyout /etc/ssl/private/ssl-cert-snakeoil.key -out /etc/ssl/certs/ssl-cert-snakeoil.pem -subj "/C=/ST=/L=/O=/OU=/CN=" +} + # Only run if the user is root if [[ $USER != 'root' ]] ; then echo "You must run this script as root!" @@ -99,6 +107,7 @@ get_conf set_conf rcs_links ssh_pubkey +set_vsftpd echo "" echo "We're all good here!"