# We need to maintain the ssh_host keys between rebuilds # otherwise things just get upset. We have the current machines IP # address in $HOSTIP
echo "%Post: sshd ssh_host keys restore"
cp -p /mnt/source/kickstart/sshd/${HOSTIP}/* /etc/ssh
chmod 600 /etc/ssh/ssh_host*
chmod 644 /etc/ssh/ssh_host*.pub
# Also we need to ensure that we issue a banner on login
echo "%Post: sshd banner added"
echo Banner /etc/issue >>/etc/ssh/sshd_config
# # must ensure that: # private keys - /etc/ssh/ssh_host* - are read/write *only* by root # public keys - /etc/ssh/ssh_host*.pub – are readable by all but only writable # by root # # Copy shouldn't loose these because of the cp options # -p preserves permissions # # FC4 note: can't leave files read only by root on server as they are then # Therefore, *MUST* reset permissions when copied.
Marked up in XHTML - ©2005 Thoughtful Solutions Ltd.