Merge "Replace the hard-code home directory with a tilde."
This commit is contained in:
commit
622c7174b0
|
@ -65,11 +65,11 @@ for FILE in tripleo-cloud/ssh-keys/*; do
|
||||||
if ! getent passwd $USER &>/dev/null; then
|
if ! getent passwd $USER &>/dev/null; then
|
||||||
useradd --create-home --user-group $USER
|
useradd --create-home --user-group $USER
|
||||||
fi
|
fi
|
||||||
mkdir -p /home/$USER/.ssh
|
eval mkdir -p ~$USER/.ssh
|
||||||
chown -R $USER:$USER /home/$USER/.ssh
|
eval chown -R $USER:$USER ~$USER/.ssh
|
||||||
chmod 700 /home/$USER/.ssh
|
eval chmod 700 ~$USER/.ssh
|
||||||
cp -f $FILE /home/$USER/.ssh/authorized_keys
|
eval cp -f $FILE ~$USER/.ssh/authorized_keys
|
||||||
chmod 600 /home/$USER/.ssh/authorized_keys
|
eval chmod 600 ~$USER/.ssh/authorized_keys
|
||||||
touch /etc/sudoers.d/$USER
|
touch /etc/sudoers.d/$USER
|
||||||
chmod 0440 /etc/sudoers.d/$USER
|
chmod 0440 /etc/sudoers.d/$USER
|
||||||
echo "$USER ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/$USER
|
echo "$USER ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/$USER
|
||||||
|
|
Loading…
Reference in New Issue