diff options
author | Tom Barrett <tom@tombarrett.xyz> | 2020-03-20 04:30:39 -0500 |
---|---|---|
committer | Tom Barrett <tom@tombarrett.xyz> | 2020-03-20 04:30:39 -0500 |
commit | eab5eca5bda076aae57e6cc82b6e08dbd5025ff3 (patch) | |
tree | 560332dfd41f0948d13fec7d34ce25ccd6202313 /scripts/krb | |
parent | 01e2662903dadce5903581eac738d0b413e521c2 (diff) |
new way of generating interfaces, only have to change hosts file now
Diffstat (limited to 'scripts/krb')
-rwxr-xr-x | scripts/krb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/scripts/krb b/scripts/krb new file mode 100755 index 0000000..4df7fef --- /dev/null +++ b/scripts/krb @@ -0,0 +1,23 @@ +#!/bin/bash +set -e + +ROOT_PASS=root +KRB5_PASS=krb5 +KRB5_ADMIN_PASS=pass +USER_PASS=tommie +IP="$(grep krb configs/hosts | cut -d ' ' -f 1)" + +scripts/debian_roll krb +lxc-attach krb -v DEBIAN_FRONTEND=noninteractive -- apt-get -y install krb5-admin-server + +scp configs/krb/krb5.conf root@$IP:/etc/ +scp configs/krb/kdc.conf root@$IP:/etc/krb5kdc/ +scp configs/krb/kadm5.acl root@$IP:/etc/krb5kdc/ + +lxc-attach krb -- bash -c 'echo -e "'$KRB5_PASS'\n'$KRB5_PASS'" | krb5_newrealm' +lxc-attach krb -- bash -c 'echo -e "'$KRB5_ADMIN_PASS'\n'$KRB5_ADMIN_PASS'" | kadmin.local addprinc root/admin' + +lxc-attach krb -- systemctl restart krb5-admin-server +lxc-attach krb -- systemctl restart krb5-kdc + +lxc-attach --clear-env krb -- bash -c 'echo -e "'$KRB5_ADMIN_PASS'\n'$USER_PASS'\n'$USER_PASS'\n" | kadmin addprinc tom' |