summaryrefslogtreecommitdiff
path: root/scripts/debian_roll
diff options
context:
space:
mode:
authorTom Barrett <tom@tombarrett.xyz>2020-02-21 04:31:11 -0600
committerTom Barrett <tom@tombarrett.xyz>2020-02-21 04:31:11 -0600
commit876baeb4d455fb811897a00e31fb5231512becd6 (patch)
treeea4ece91613f7b84fcef0b72264a17c1fbefc45c /scripts/debian_roll
parentde098e1f22ae6cdde62aa9f6b75697852e872ced (diff)
starting out nfs
Diffstat (limited to 'scripts/debian_roll')
-rwxr-xr-xscripts/debian_roll11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/debian_roll b/scripts/debian_roll
index e7ae1ff..83b7d76 100755
--- a/scripts/debian_roll
+++ b/scripts/debian_roll
@@ -28,3 +28,14 @@ lxc-attach -n $NAME -- bash -c 'echo "AllowTcpForwarding yes" >> /etc/ssh/sshd_c
lxc-attach -n $NAME -- bash -c 'echo "X11UseLocalhost yes" >> /etc/ssh/sshd_config'
lxc-attach -n $NAME -- bash -c 'echo "PermitRootLogin yes" >> /etc/ssh/sshd_config'
lxc-attach -n $NAME -- systemctl restart sshd
+
+# setup networking
+IP="$(lxc-info -n $NAME | grep IP | tr -s ' ' | cut -d ' ' -f 2)"
+sshpass -p $ROOT_PASS ssh-copy-id -o "StrictHostKeyChecking=no" root@$IP
+scp configs/$NAME/interfaces root@$IP:/etc/network/
+scp configs/hosts root@$IP:/etc/
+lxc-attach -n $NAME -- systemctl restart networking
+ssh-keygen -R "$IP"
+
+IP="$(lxc-info -n $NAME | grep IP | tr -s ' ' | cut -d ' ' -f 2)"
+sshpass -p $ROOT_PASS ssh-copy-id -o "StrictHostKeyChecking=no" root@$IP