[ssh/ssh_known_hosts,cron.d/sshFingerprint] Typo dans le cron, on génère un known_hosts pas serveur avec les clefs ssh qui sont dans ldap
Ignore-this: 6a14625d4b5bf8117fb70af6744afea1 darcs-hash:20130122011525-3a55a-023e5d840a69873b21cfe0b64f28bcec3ad8d531.gz
This commit is contained in:
parent
24e3233e7b
commit
57b48d0f35
2 changed files with 30 additions and 1 deletions
|
@ -12,4 +12,4 @@ include("ip")
|
|||
|
||||
@# On vérifie si les clef ssh de la machine ont changés. Si oui, on les mets à jours dans ldap
|
||||
min=int(admip().split('.')[3])%60
|
||||
print "%s 2 * * * /usr/scripts/gestion/gen_confs/populate_sshFingerprint.py" % min
|
||||
print "%s 9 * * * root /usr/scripts/gestion/gen_confs/populate_sshFingerprint.py" % min
|
||||
|
|
29
Python/etc/ssh/ssh_known_hosts
Normal file
29
Python/etc/ssh/ssh_known_hosts
Normal file
|
@ -0,0 +1,29 @@
|
|||
# -*- coding: utf-8; mode: python -*-
|
||||
|
||||
include("mode/space")
|
||||
|
||||
header("Configuration du serveur ssh")
|
||||
|
||||
|
||||
import sys
|
||||
sys.path.append('/usr/scripts/lc_ldap')
|
||||
sys.path.append('/usr/scripts/gestion')
|
||||
import lc_ldap
|
||||
import config
|
||||
|
||||
conn=lc_ldap.lc_ldap_admin()
|
||||
machines=conn.search("objectClass=machineCrans")
|
||||
|
||||
|
||||
key_machines={}
|
||||
for machine in machines:
|
||||
for key in machine['sshFingerprint']:
|
||||
if not key.value in key_machines.keys():
|
||||
key_machines[key.value]=set()
|
||||
for host in machine['host']:
|
||||
key_machines[key.value].add(host.value)
|
||||
key_machines[key.value].add(host.value.split('.')[0])
|
||||
for ip in machine['ipHostNumber']:
|
||||
key_machines[key.value].add("%s" % ip)
|
||||
for key,hosts in key_machines.items():
|
||||
sys.stdout.write("%s %s" % (','.join(hosts),key))
|
Loading…
Add table
Add a link
Reference in a new issue