summaryrefslogtreecommitdiff
path: root/samples/update_key_cache.sh.sample
diff options
context:
space:
mode:
authorPaul Buetow <pbuetow@mimecast.com>2023-06-21 10:56:41 +0000
committerPaul Buetow <pbuetow@mimecast.com>2023-06-21 10:56:41 +0000
commit51747cc62ae47af7d369e3e43d41f156835e9dfa (patch)
tree691e46f0930804e6a8ad0a234f293db917859f5a /samples/update_key_cache.sh.sample
parentdaaca90c2c1c9debc339ff28c3f0b928b5041d3e (diff)
parentc5fd63e099cec30154e2a9c0b5ee7715491263bf (diff)
Merge branch 'develop' into 'master'v4.2.0
DTail: Restrict SSH MAC algorithms allowed - Update of few dependencies See merge request Storage/dtail!7
Diffstat (limited to 'samples/update_key_cache.sh.sample')
-rw-r--r--samples/update_key_cache.sh.sample33
1 files changed, 0 insertions, 33 deletions
diff --git a/samples/update_key_cache.sh.sample b/samples/update_key_cache.sh.sample
deleted file mode 100644
index 9817f04..0000000
--- a/samples/update_key_cache.sh.sample
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/bash
-
-declare -r CACHEDIR=/var/run/dserver/cache
-declare -r DSERVER_USER=dserver
-
-echo "Updating SSH key cache"
-
-ls /home/ | while read remoteuser; do
- keysfile=/home/$remoteuser/.ssh/authorized_keys
-
- if [ -f $keysfile ]; then
- cachefile=$CACHEDIR/$remoteuser.authorized_keys
- echo "Caching $keysfile -> $cachefile"
-
- cp $keysfile $cachefile
- chown $DSERVER_USER $cachefile
- chmod 600 $cachefile
- fi
-done
-
-# Cleanup obsolete public SSH keys
-find $CACHEDIR -name \*.authorized_keys -type f |
-while read cachefile; do
- remoteuser=$(basename $cachefile | cut -d. -f1)
- keysfile=/home/$remoteuser/.ssh/authorized_keys
-
- if [ ! -f $keysfile ]; then
- echo "Deleting obsolete cache file $cachefile"
- rm $cachefile
- fi
-done
-
-echo "All set..."