Commit 93919234 authored by Pietro Albini's avatar Pietro Albini

lxd-container: rename "manage" user to "manager" during bootstrap

parent 8d8c8740
......@@ -15,21 +15,21 @@ ex() {
ex apt-get update
ex apt-get install python openssh-server sudo -y
# Create the "manage" user in the passwordless sudo group
# Create the "manager" user in the passwordless sudo group
if ! ex grep -q -E "^passwordless-sudo:" /etc/group; then
ex addgroup passwordless-sudo
fi
if ! ex grep -q -E "^manage:" /etc/passwd; then
ex adduser manage --home /home/manage --gecos "" --disabled-password
ex adduser manage passwordless-sudo
if ! ex grep -q -E "^manager:" /etc/passwd; then
ex adduser manager --home /home/manager --gecos "" --disabled-password
ex adduser manager passwordless-sudo
fi
# Allow the passwordless-sudo group to use... well... passwordless sudo?
echo "%passwordless-sudo ALL=(ALL:ALL) NOPASSWD:ALL" | \
ex bash -c "cat >> /etc/sudoers"
# Authorize the hypervisor manage to connect to the guest manage
ex sudo -u manage mkdir -p /home/manage/.ssh
cat /home/manage/.ssh/authorized_keys | \
ex sudo -u manage bash -c "cat > /home/manage/.ssh/authorized_keys"
ex chmod 0600 /home/manage/.ssh/authorized_keys
# Authorize the hypervisor manager to connect to the guest manager
ex sudo -u manager mkdir -p /home/manager/.ssh
cat /home/manager/.ssh/authorized_keys | \
ex sudo -u manager bash -c "cat > /home/manager/.ssh/authorized_keys"
ex chmod 0600 /home/manager/.ssh/authorized_keys
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment