Editing
SSH Host Key Management
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Updating 'known_hosts' == Currently, aslan runs a job that uses the master '''hosts''' file located at http://config/config/hosts as input to the '''ssh-keyscan''' program to retrieve the host keys for all systems and put them in http://config/config/ssh/known_hosts. This script is '''host_update.sh''' and is included here for reference: <pre>#!/bin/zsh -f # # update the known_hosts file from the master hosts file when needed BASE=/workspace/nginx/config HOSTS_DATE=0 if [ -e $BASE/hosts.date ]; then HOSTS_DATE=`cat $BASE/hosts.date` fi if [[ $HOSTS_DATE != `stat -c '%y' $BASE/hosts` ]] || [[ $1 = '-f' ]]; then # # scrape the host keys from the known hosts and put them up for access on the config server # ssh-keyscan -f $BASE/hosts -t rsa,ecdsa | grep -v localhost > $BASE/ssh/known_hosts cat $BASE/hosts | cut -f 1 | ssh-keyscan -f - -t rsa,ecdsa >> $BASE/ssh/known_hosts cat $BASE/ssh/pfsense_host_key >> $BASE/ssh/known_hosts stat -c '%y' $BASE/hosts > $BASE/hosts.date sha1sum $BASE/ssh/known_hosts > $BASE/ssh/known_hosts.sum fi</pre> The script is run hourly, but the test to see if the '''hosts''' file has changed is rather minimal, so resource usage isn't a factor.
Summary:
Please note that all contributions to WilliamsNet Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
WilliamsNet Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Navigation
Commons
Architecture
How-To
Systems
Hardware
SysAdmin
Kubernetes
OpenSearch
Special
Pages to create
All pages
Recent changes
Random page
Help about MediaWiki
Formatting Help
Tools
What links here
Related changes
Special pages
Page information