Merge "Replace the hard-code home directory with a tilde."

This commit is contained in:
Jenkins 2015-12-18 14:17:10 +00:00 committed by Gerrit Code Review
commit 622c7174b0
1 changed files with 5 additions and 5 deletions

View File

@ -65,11 +65,11 @@ for FILE in tripleo-cloud/ssh-keys/*; do
if ! getent passwd $USER &>/dev/null; then
useradd --create-home --user-group $USER
fi
mkdir -p /home/$USER/.ssh
chown -R $USER:$USER /home/$USER/.ssh
chmod 700 /home/$USER/.ssh
cp -f $FILE /home/$USER/.ssh/authorized_keys
chmod 600 /home/$USER/.ssh/authorized_keys
eval mkdir -p ~$USER/.ssh
eval chown -R $USER:$USER ~$USER/.ssh
eval chmod 700 ~$USER/.ssh
eval cp -f $FILE ~$USER/.ssh/authorized_keys
eval chmod 600 ~$USER/.ssh/authorized_keys
touch /etc/sudoers.d/$USER
chmod 0440 /etc/sudoers.d/$USER
echo "$USER ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/$USER