still trying to get pub key working

This commit is contained in:
Anthony Young 2011-11-10 13:09:25 -08:00
parent ddb44b4e09
commit b7661282d1

View file

@ -191,12 +191,13 @@ EOF
# Setup stack user with our key # Setup stack user with our key
if [ -e ~/.ssh/id_rsa.pub ]; then if [ -e ~/.ssh/id_rsa.pub ]; then
PUB_KEY=`cat ~/.ssh/id_rsa.pub`
cat >> $vm_dir/uec/user-data<<EOF cat >> $vm_dir/uec/user-data<<EOF
mkdir -p /opt/stack mkdir -p /opt/stack
useradd stack -s /bin/bash -d /opt/stack -G libvirtd || true useradd stack -s /bin/bash -d /opt/stack -G libvirtd || true
echo stack:pass | chpasswd echo stack:pass | chpasswd
mkdir -p /opt/stack/.ssh mkdir -p /opt/stack/.ssh
echo "`cat ~/.ssh/id_rsa.pub`" > /opt/stack/.ssh/authorized_keys echo "$PUB_KEY" > /opt/stack/.ssh/authorized_keys
chown -R stack /opt/stack chown -R stack /opt/stack
chmod 700 /opt/stack/.ssh chmod 700 /opt/stack/.ssh
chmod 600 /opt/stack/.ssh/authorized_keys chmod 600 /opt/stack/.ssh/authorized_keys