From 27b3ff0800ed9002631291f3e0790ed5a470be74 Mon Sep 17 00:00:00 2001 From: Tom Barrett Date: Tue, 29 Dec 2020 14:19:50 +0100 Subject: 2020 update --- lxc/arch_roll | 9 ++++----- lxc/debian_roll | 6 +++--- lxc/debian_setup | 9 +++++++++ lxc/setup | 9 --------- 4 files changed, 16 insertions(+), 17 deletions(-) create mode 100755 lxc/debian_setup delete mode 100755 lxc/setup (limited to 'lxc') diff --git a/lxc/arch_roll b/lxc/arch_roll index ce97bfe..cf1dfa7 100755 --- a/lxc/arch_roll +++ b/lxc/arch_roll @@ -16,8 +16,7 @@ lxc-attach -n $NAME -- pacman -Sy --noconfirm \ git sudo vim openssh xorg-xauth xorg-xhost fakeroot binutils # setup user -lxc-attach -n $NAME -- useradd $USER -lxc-attach -n $NAME -- mkdir /home/$USER +lxc-attach -n $NAME -- useradd -m $USER lxc-attach -n $NAME -- bash -c 'echo "'$USER' ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers' lxc-attach -n $NAME -- bash -c 'echo -e "'$PASS'\n'$PASS'" | passwd $USER' @@ -29,9 +28,9 @@ lxc-attach -n $NAME -- bash -c 'cd /home/'$USER'/yay && sudo -u '$USER' makepkg lxc-attach -n $NAME -- bash -c 'sudo -u '$USER' yay -Syu --noconfirm' # setup x11 forwarding -lxc-attach -n $NAME -- bash -c 'echo "X11Forwarding yes" >> /etc/ssh/sshd_config' -lxc-attach -n $NAME -- bash -c 'echo "AllowTcpForwarding yes" >> /etc/ssh/sshd_config' -lxc-attach -n $NAME -- bash -c 'echo "X11UseLocalhost yes" >> /etc/ssh/sshd_config' +# lxc-attach -n $NAME -- bash -c 'echo "X11Forwarding yes" >> /etc/ssh/sshd_config' +# lxc-attach -n $NAME -- bash -c 'echo "AllowTcpForwarding yes" >> /etc/ssh/sshd_config' +# lxc-attach -n $NAME -- bash -c 'echo "X11UseLocalhost yes" >> /etc/ssh/sshd_config' lxc-attach -n $NAME -- systemctl start sshd # display info diff --git a/lxc/debian_roll b/lxc/debian_roll index 7ea23c3..5ae7b7e 100755 --- a/lxc/debian_roll +++ b/lxc/debian_roll @@ -20,9 +20,9 @@ lxc-attach -n $NAME -- adduser $USER --gecos "" --disabled-password lxc-attach -n $NAME -- bash -c 'echo -e "'$PASS'\n'$PASS'" | passwd $USER' # setup x11 forwarding -lxc-attach -n $NAME -- bash -c 'echo "AllowTcpForwarding yes" >> /etc/ssh/sshd_config' -lxc-attach -n $NAME -- bash -c 'echo "X11UseLocalhost yes" >> /etc/ssh/sshd_config' -lxc-attach -n $NAME -- systemctl restart sshd +# lxc-attach -n $NAME -- bash -c 'echo "AllowTcpForwarding yes" >> /etc/ssh/sshd_config' +# lxc-attach -n $NAME -- bash -c 'echo "X11UseLocalhost yes" >> /etc/ssh/sshd_config' +# lxc-attach -n $NAME -- systemctl restart sshd # display info lxc-info -n $NAME diff --git a/lxc/debian_setup b/lxc/debian_setup new file mode 100755 index 0000000..6cfe699 --- /dev/null +++ b/lxc/debian_setup @@ -0,0 +1,9 @@ +#!/bin/bash +set -e + +virsh net-start default +virsh net-autostart default + +echo "kernel.unprivileged_userns_clone=1" > /etc/sysctl.d/80-lxc-userns.conf +echo "tom veth virbr0 2" > /etc/lxc/lxc-usernet +echo "you should reboot now." diff --git a/lxc/setup b/lxc/setup deleted file mode 100755 index 6cfe699..0000000 --- a/lxc/setup +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -set -e - -virsh net-start default -virsh net-autostart default - -echo "kernel.unprivileged_userns_clone=1" > /etc/sysctl.d/80-lxc-userns.conf -echo "tom veth virbr0 2" > /etc/lxc/lxc-usernet -echo "you should reboot now." -- cgit v1.2.3