aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xkvmx-create12
1 files changed, 6 insertions, 6 deletions
diff --git a/kvmx-create b/kvmx-create
index 33a7351..fdc3c7b 100755
--- a/kvmx-create
+++ b/kvmx-create
@@ -342,14 +342,14 @@ EOF
pubkey="$DIRNAME/share/ssh/insecure_private_key.pub"
fi
- kvmx_sudo_run chroot $WORK/ mkdir -p /home/user/.ssh
- kvmx_sudo_run chroot $WORK/ chmod 700 /home/user/.ssh
- kvmx_sudo_run cp $pubkey $WORK/home/user/.ssh/authorized_keys
- kvmx_sudo_run chroot $WORK/ chmod 600 /home/user/.ssh/authorized_keys
- kvmx_sudo_run touch $WORK/home/user/.hushlogin
+ kvmx_sudo_run chroot $WORK/ mkdir -p /home/$user/.ssh
+ kvmx_sudo_run chroot $WORK/ chmod 700 /home/$user/.ssh
+ kvmx_sudo_run cp $pubkey $WORK/home/$user/.ssh/authorized_keys
+ kvmx_sudo_run chroot $WORK/ chmod 600 /home/$user/.ssh/authorized_keys
+ kvmx_sudo_run touch $WORK/home/$user/.hushlogin
fi
- kvmx_sudo_run chroot $WORK/ chown -R user.user /home/user
+ kvmx_sudo_run chroot $WORK/ chown -R $user.$user /home/$user
echo "$user:$password" | kvmx_sudo_run chroot $WORK/ chpasswd
}