Lines Matching +full:key +full:- +full:home
2 shopt -s nullglob
4 # We want to iterate over all system users, check if they are opted-in to ssh
6 while read -r user; do
7 home="$(eval echo "~$user")" || continue
8 link="$(readlink "$home"/.ssh/authorized_keys 2>/dev/null)" || continue
9 # Users are only opted-in if they symlink to our well-known directory where
12 echo "Ignoring $user $home/.ssh/authorized_keys" >&2
17 declare -A basemap=()
18 declare -a dirs=(
20 "$home/.ssh/authorized_keys.d"
29 # /usr/share/authorized_keys.d/root/10-key
30 # /usr/share/authorized_keys.d/root/15-key
31 # /run/authorized_keys.d/root/10-key
32 # /run/authorized_keys.d/root/20-key
34 # ["10-key"]="/run/authorized_keys.d/root/10-key"
35 # ["15-key"]="/usr/share/authorized_keys.d/root/15-key"
36 # ["20-key"]="/run/authorized_keys.d/root/20-key"
42 rm -f /run/authorized_keys.tmp
44 for key in $(printf "%s\n" "${!basemap[@]}" | sort -r); do
45 echo " Including ${basemap[$key]}" >&2
46 cat "${basemap[$key]}" >>/run/authorized_keys.tmp
48 mkdir -p /run/authorized_keys
51 done < <(cut -d':' -f1 /etc/passwd)