|
@@ -145,3 +145,15 @@ if [ -f ~/.ssh/config ]; then
|
|
|
hosts=($(grep '^Host [^*]' ~/.ssh/config | sed 's/Host //'))
|
|
|
compctl -k hosts mssh
|
|
|
fi
|
|
|
+
|
|
|
+#
|
|
|
+# Hosting stuff
|
|
|
+#
|
|
|
+http_auth_ssha() {
|
|
|
+ read "username?username: "
|
|
|
+ read "password?password: "
|
|
|
+ salt="$(openssl rand -base64 3)"
|
|
|
+ sha1="$(printf "%s%s" "${password}" "${salt}" | openssl dgst -binary -sha1 | sed 's#$#'"${salt}"'#' | base64)"
|
|
|
+ printf "%s:{SSHA}%s\n" "${username}" "${sha1}"
|
|
|
+}
|
|
|
+
|