File: authorized-keys-command.sh

package info (click to toggle)
nsscache 0.49-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 19,664 kB
  • sloc: python: 8,661; xml: 584; sh: 304; makefile: 19
file content (12 lines) | stat: -rwxr-xr-x 386 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/sh

# This script returns one or more authorized keys for use by SSH, by extracting
# them from a local cache file /etc/sshkey.cache.
#
# Ensure this script is mentioned in the sshd_config like so:
#
# AuthorizedKeysCommand /path/to/nsscache/authorized-keys-command.sh

awk -F: -v name="$1" '$0 ~ name {print $2}' /etc/sshkey.cache | \
    tr -d "[']" | \
    sed -e 's/, /\n/g'