Add vsftpd

This commit is contained in:
Alexandre CATTEAU 2021-11-12 19:32:49 +01:00
parent 2ecf42280b
commit 6d13bd9aa8

View File

@ -12,7 +12,7 @@
init() { init() {
echo "Starting initialization" echo "Starting initialization"
echo $hostname > /etc/hostname 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 localectl set-keymap $keymap
timedatectl set-timezone $timezone timedatectl set-timezone $timezone
systemctl disable apt-daily-upgrade.timer 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 sed -i -e "s/$deb_apt_default_repo/$deb_apt_repo/g" /etc/apt/sources.list
apt update apt update
apt upgrade -y apt upgrade -y
apt install -y vim tree tmux neofetch apt install -y vim tree tmux neofetch vsftpd cryptsetup
} }
add_users() { add_users() {
@ -68,6 +68,14 @@ ssh_pubkey() {
sudo -H -u $user mv /home/$user/.ssh/$remote_pubkey /home/$user/.ssh/authorized_keys 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 # Only run if the user is root
if [[ $USER != 'root' ]] ; then if [[ $USER != 'root' ]] ; then
echo "You must run this script as root!" echo "You must run this script as root!"
@ -99,6 +107,7 @@ get_conf
set_conf set_conf
rcs_links rcs_links
ssh_pubkey ssh_pubkey
set_vsftpd
echo "" echo ""
echo "We're all good here!" echo "We're all good here!"