|
@@ -617,7 +617,7 @@ function enable_monkeysphere {
|
617
|
617
|
# The admin user is the identity certifier
|
618
|
618
|
fpr=$(gpg --with-colons --fingerprint $MY_GPG_PUBLIC_KEY_ID | grep fpr | head -n 1 | awk -F ':' '{print $10}')
|
619
|
619
|
monkeysphere-authentication add-identity-certifier $fpr
|
620
|
|
- monkeysphere-host publish-key
|
|
620
|
+ monkeysphere-host publish-key
|
621
|
621
|
else
|
622
|
622
|
sed -i 's|#AuthorizedKeysFile|AuthorizedKeysFile|g' /etc/ssh/sshd_config
|
623
|
623
|
sed -i 's|AuthorizedKeysFile.*|AuthorizedKeysFile %h/.ssh/authorized_keys|g' /etc/ssh/sshd_config
|
|
@@ -851,6 +851,16 @@ function export_settings {
|
851
|
851
|
exit 0
|
852
|
852
|
}
|
853
|
853
|
|
|
854
|
+function refresh_gpg_keys {
|
|
855
|
+ for d in /home/*/ ; do
|
|
856
|
+ USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
|
|
857
|
+ if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then
|
|
858
|
+ su -c 'gpg --refresh-keys' - $USERNAME
|
|
859
|
+ fi
|
|
860
|
+ done
|
|
861
|
+ exit 0
|
|
862
|
+}
|
|
863
|
+
|
854
|
864
|
function show_help {
|
855
|
865
|
echo ''
|
856
|
866
|
echo "${PROJECT_NAME}-sec"
|
|
@@ -861,6 +871,7 @@ function show_help {
|
861
|
871
|
echo $' -h --help Show help'
|
862
|
872
|
echo $' -e --export Export security settings to a file'
|
863
|
873
|
echo $' -i --import Import security settings from a file'
|
|
874
|
+ echo $' -r --refresh Refresh GPG keys for all users'
|
864
|
875
|
echo ''
|
865
|
876
|
exit 0
|
866
|
877
|
}
|
|
@@ -885,6 +896,10 @@ case $key in
|
885
|
896
|
shift
|
886
|
897
|
IMPORT_FILE="$1"
|
887
|
898
|
;;
|
|
899
|
+ # Refresh GPG keys
|
|
900
|
+ -r|--refresh)
|
|
901
|
+ refresh_gpg_keys
|
|
902
|
+ ;;
|
888
|
903
|
*)
|
889
|
904
|
# unknown option
|
890
|
905
|
;;
|