We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f72635e commit 98ece14Copy full SHA for 98ece14
copy/opt/core/bin/generate-root-ssh-key renamed to copy/opt/core/bin/generate-ssh-key
@@ -15,6 +15,9 @@ if ! echo n | ssh-keygen -f "${ID_RSA}" -N '' &>/dev/null; then
15
exit 1
16
fi
17
18
+# Try to use sudo for non root user
19
+[[ "${USER}" == "root" ]] && SUDO="sudo"
20
+
21
# Put information into mdata variables
-mdata-put "${USER}_ssh_rsa" < "${ID_RSA}"
-mdata-put "${USER}_ssh_rsa.pub" < "${ID_RSA}.pub"
22
+${SUDO} mdata-put "${USER}_ssh_rsa" < "${ID_RSA}"
23
+${SUDO} mdata-put "${USER}_ssh_rsa.pub" < "${ID_RSA}.pub"
0 commit comments