- ..
- 2to3
- 2to3-3.11
- acountry
- activate
- adig
- ahost
- bsdcat
- bsdcpio
- bsdtar
- bunzip2
- bzcat
- bzcmp
- bzdiff
- bzegrep
- bzfgrep
- bzgrep
- bzip2
- bzip2recover
- bzless
- bzmore
- c_rehash
- captoinfo
- clear
- compile_et
- conda
- conda-content-trust
- conda-env
- conda2solv
- cph
- curl-config
- deactivate
- derb
- dumpsolv
- genbrk
- gencfu
- gencnval
- gendict
- genrb
- gss-client
- icu-config
- icuinfo
- idle3
- idle3.11
- infocmp
- infotocap
- installcheck
- jsondiff
- jsonpatch
- jsonpointer
- k5srvutil
- kadmin
- kdestroy
- kinit
- klist
- kpasswd
- krb5-config
- ksu
- kswitch
- ktutil
- kvno
- lz4
- lz4c
- lz4cat
- lzcat
- lzcmp
- lzdiff
- lzegrep
- lzfgrep
- lzgrep
- lzless
- lzma
- lzmadec
- lzmainfo
- lzmore
- makeconv
- mamba-package
- mergesolv
- ncursesw6-config
- nghttp
- nghttpd
- nghttpx
- normalizer
- openssl
- pcre2-config
- pcre2_jit_test
- pcre2grep
- pcre2test
- pip
- pip3
- pkgdata
- pydoc
- pydoc3
- pydoc3.11
- python
- python3
- python3-config
- python3.1
- python3.11
- python3.11-config
- repo2solv
- reset
- sclient
- sim_client
- sqlite3
- sqlite3_analyzer
- tabs
- tclsh
- tclsh8.6
- testsolv
- tic
- toe
- tput
- tqdm
- tset
- unlz4
- unlzma
- unxz
- unzstd
- uuclient
- wheel
- wish
- wish8.6
- x86_64-conda-linux-gnu-ld
- x86_64-conda_cos7-linux-gnu-ld
- xml2-config
- xmlcatalog
- xmllint
- xz
- xzcat
- xzcmp
- xzdec
- xzdiff
- xzegrep
- xzfgrep
- xzgrep
- xzless
- xzmore
- zstd
- zstdcat
- zstdgrep
- zstdless
- zstdmt
k5srvutil @74036c5 — raw · history · blame
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | #!/bin/sh
# list_princs keytab
# returns a list of principals in the keytab
# sorted and uniquified
list_princs() {
klist -k $keytab | awk '(NR > 3) {print $2}' | sort | uniq
}
set_command() {
if [ x$command != x ] ; then
cmd_error Only one command can be specified
usage
exit 1
fi
command=$1
}
#interactive_prompt prompt princ
# If in interactive mode return true if the principal should be acted on
# otherwise return true all the time
interactive_prompt() {
if [ $interactive = 0 ] ; then
return 0
fi
printf "%s for %s? [yn]" "$1" "$2"
read ans
case $ans in
n*|N*)
return 1
;;
esac
return 0
}
cmd_error() {
echo $@ 2>&1
}
usage() {
echo "Usage: $0 [-i] [-f file] [-e keysalts] list|change|delete|delold"
}
change_key() {
princs=`list_princs `
for princ in $princs; do
if interactive_prompt "Change key " $princ; then
kadmin -k -t $keytab -p $princ -q \
"ktadd -k $keytab $keysalts $princ"
fi
done
}
delete_old_keys() {
princs=`list_princs `
for princ in $princs; do
if interactive_prompt "Delete old keys " $princ; then
kadmin -k -t $keytab -p $princ -q "ktrem -k $keytab $princ old"
fi
done
}
delete_keys() {
interactive=1
princs=`list_princs `
for princ in $princs; do
if interactive_prompt "Delete all keys " $princ; then
kadmin -p $princ -k -t $keytab -q "ktrem -k $keytab $princ all"
fi
done
}
keytab=/etc/krb5.keytab
interactive=0
keysalts=""
while [ $# -gt 0 ] ; do
opt=$1
shift
case $opt in
"-f")
keytab=$1
shift
;;
"-i")
interactive=1
;;
"-e")
keysalts="$keysalts -e \"$1\""
shift
;;
change|delold|delete|list)
set_command $opt
;;
*)
cmd_error Illegal option: $opt
usage
exit 1
;;
esac
done
case $command in
change)
change_key
;;
delold)
delete_old_keys
;;
delete)
delete_keys
;;
list)
klist -k $keytab
;;
*)
usage
;;
esac
|