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() { ...@@ -15,21 +15,21 @@ ex() {
ex apt-get update ex apt-get update
ex apt-get install python openssh-server sudo -y 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 if ! ex grep -q -E "^passwordless-sudo:" /etc/group; then
ex addgroup passwordless-sudo ex addgroup passwordless-sudo
fi fi
if ! ex grep -q -E "^manage:" /etc/passwd; then if ! ex grep -q -E "^manager:" /etc/passwd; then
ex adduser manage --home /home/manage --gecos "" --disabled-password ex adduser manager --home /home/manager --gecos "" --disabled-password
ex adduser manage passwordless-sudo ex adduser manager passwordless-sudo
fi fi
# Allow the passwordless-sudo group to use... well... passwordless sudo? # Allow the passwordless-sudo group to use... well... passwordless sudo?
echo "%passwordless-sudo ALL=(ALL:ALL) NOPASSWD:ALL" | \ echo "%passwordless-sudo ALL=(ALL:ALL) NOPASSWD:ALL" | \
ex bash -c "cat >> /etc/sudoers" ex bash -c "cat >> /etc/sudoers"
# Authorize the hypervisor manage to connect to the guest manage # Authorize the hypervisor manager to connect to the guest manager
ex sudo -u manage mkdir -p /home/manage/.ssh ex sudo -u manager mkdir -p /home/manager/.ssh
cat /home/manage/.ssh/authorized_keys | \ cat /home/manager/.ssh/authorized_keys | \
ex sudo -u manage bash -c "cat > /home/manage/.ssh/authorized_keys" ex sudo -u manager bash -c "cat > /home/manager/.ssh/authorized_keys"
ex chmod 0600 /home/manage/.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