diff options
Diffstat (limited to 'scripts/debian_roll')
-rwxr-xr-x | scripts/debian_roll | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/scripts/debian_roll b/scripts/debian_roll deleted file mode 100755 index caf652c..0000000 --- a/scripts/debian_roll +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -set -e - -NAME=$1 -USER=tom -PASS=tom -ROOT_PASS=root - -# init -lxc-create $NAME -t download -- --dist debian --release buster --arch amd64 -lxc-start $NAME -# TODO maybe just info until ip shows up? -sleep 15 - -# install basics -lxc-attach $NAME -- apt-get update -lxc-attach $NAME -- apt-get dist-upgrade -lxc-attach $NAME -- apt-get install -y apt-utils -lxc-attach $NAME -- apt-get install -y sudo openssh-server x11-xserver-utils - -# setup users -lxc-attach $NAME -- bash -c 'echo -e "'$ROOT_PASS'\n'$ROOT_PASS'" | passwd' -lxc-attach $NAME -- adduser $USER --gecos "" --disabled-password -lxc-attach $NAME -- bash -c 'echo -e "'$PASS'\n'$PASS'" | passwd $USER' - -# setup x11 forwarding -lxc-attach $NAME -- bash -c 'echo "AllowTcpForwarding yes" >> /etc/ssh/sshd_config' -lxc-attach $NAME -- bash -c 'echo "X11UseLocalhost yes" >> /etc/ssh/sshd_config' -lxc-attach $NAME -- bash -c 'echo "PermitRootLogin yes" >> /etc/ssh/sshd_config' -lxc-attach $NAME -- systemctl restart sshd - -# setup networking -IP="$(lxc-info $NAME | grep IP | tr -s ' ' | cut -d ' ' -f 2)" -DESIRED_IP="$(grep $NAME configs/hosts | cut -d ' ' -f 1)" - -sed "s/ADDRESS/$DESIRED_IP/" configs/interfaces > tmp/interfaces -sshpass -p $ROOT_PASS scp -o "StrictHostKeyChecking=no" tmp/interfaces root@$IP:/etc/network/interfaces -sshpass -p $ROOT_PASS scp -o "StrictHostKeyChecking=no" configs/hosts root@$IP:/etc/hosts -lxc-attach $NAME -- systemctl restart networking - -# add ssh key -sshpass -p $ROOT_PASS ssh-copy-id -o "StrictHostKeyChecking=no" root@$DESIRED_IP |