|
@@ -335,6 +335,20 @@ function interactive_setup {
|
335
|
335
|
clear
|
336
|
336
|
}
|
337
|
337
|
|
|
338
|
+function send_monkeysphere_server_keys_to_users {
|
|
339
|
+ monkeysphere_server_keys=$(monkeysphere-host show-key | grep $"OpenPGP fingerprint" | awk -F ' ' '{print $3}')
|
|
340
|
+ for d in /home/*/ ; do
|
|
341
|
+ USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
|
|
342
|
+ if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then
|
|
343
|
+ if [ ! -d /home/$USERNAME/.monkeysphere ]; then
|
|
344
|
+ mkdir /home/$USERNAME/.monkeysphere
|
|
345
|
+ fi
|
|
346
|
+ echo $monkeysphere_server_keys > /home/$USERNAME/.monkeysphere/server_keys
|
|
347
|
+ chown -R $USERNAME:$USERNAME /home/$USERNAME/.monkeysphere
|
|
348
|
+ fi
|
|
349
|
+ done
|
|
350
|
+}
|
|
351
|
+
|
338
|
352
|
function regenerate_ssh_host_keys {
|
339
|
353
|
if [[ $REGENERATE_SSH_HOST_KEYS == "yes" ]]; then
|
340
|
354
|
rm -f /etc/ssh/ssh_host_*
|
|
@@ -352,7 +366,8 @@ function regenerate_ssh_host_keys {
|
352
|
366
|
monkeysphere-host import-key /etc/ssh/ssh_host_rsa_key ssh://$DEFAULT_DOMAIN_NAME
|
353
|
367
|
SSH_ONION_HOSTNAME=$(cat ${COMPLETION_FILE} | grep 'ssh onion domain' | awk -F ':' '{print $2}')
|
354
|
368
|
monkeysphere-host import-key /etc/ssh/ssh_host_rsa_key ssh://$SSH_ONION_HOSTNAME
|
355
|
|
- monkeysphere-host publish-key --all
|
|
369
|
+ monkeysphere-host publish-key
|
|
370
|
+ send_monkeysphere_server_keys_to_users
|
356
|
371
|
echo $'updated monkeysphere ssh host key'
|
357
|
372
|
systemctl restart ssh
|
358
|
373
|
fi
|
|
@@ -618,7 +633,8 @@ function enable_monkeysphere {
|
618
|
633
|
# The admin user is the identity certifier
|
619
|
634
|
fpr=$(gpg --with-colons --fingerprint $MY_GPG_PUBLIC_KEY_ID | grep fpr | head -n 1 | awk -F ':' '{print $10}')
|
620
|
635
|
monkeysphere-authentication add-identity-certifier $fpr
|
621
|
|
- monkeysphere-host publish-key --all
|
|
636
|
+ monkeysphere-host publish-key
|
|
637
|
+ send_monkeysphere_server_keys_to_users
|
622
|
638
|
else
|
623
|
639
|
sed -i 's|#AuthorizedKeysFile|AuthorizedKeysFile|g' /etc/ssh/sshd_config
|
624
|
640
|
sed -i 's|AuthorizedKeysFile.*|AuthorizedKeysFile %h/.ssh/authorized_keys|g' /etc/ssh/sshd_config
|