diff --git a/elements/local-config/install.d/62-ssh-key b/elements/local-config/install.d/62-ssh-key index e4f01a077..9e34f23d2 100755 --- a/elements/local-config/install.d/62-ssh-key +++ b/elements/local-config/install.d/62-ssh-key @@ -5,8 +5,6 @@ set -e if [ -e "/tmp/in_target.d/ssh-authorized-keys" ]; then - if [ -d ~stack ]; then - sudo -u stack mkdir ~stack/.ssh - sudo -Hiu stack dd of=~stack/.ssh/authorized_keys oflag=append conv=notrunc if=/tmp/in_target.d/ssh-authorized-keys - fi + mkdir -p /root/.ssh + cat /tmp/in_target.d/ssh-authorized-keys >> /root/.ssh/authorized_keys fi diff --git a/elements/stackuser/install.d/50-user b/elements/stackuser/install.d/50-user index b5701f83a..6f2e706ab 100755 --- a/elements/stackuser/install.d/50-user +++ b/elements/stackuser/install.d/50-user @@ -12,13 +12,17 @@ stack EOF -sudo_file=/etc/sudoers.d/stack cat > /etc/sudoers.d/stack <> /home/stack/.ssh/authorized_keys + chown -R stack:stack /home/stack/.ssh +fi