Changes

Jump to: navigation, search

Debian template creation

483 bytes added, 23:58, 18 May 2015
ssh key gen for Jessie added
This is only useful if you installed SSH. Each individual [[VE]] should have its own pair of SSH host keys. The code below will wipe out the existing SSH keys and instruct the newly-created [[VE]] to create new SSH keys on first boot.
<!-- please do not remove <source>...</source> pair of tags below,==== for Jessie ==== otherwise quotes after -N (-N '') are not visible -->
<source lang="bash">
# Save /etc/rc.local copymv /etc/rc.local /etc/rc.local.orig # ssh host keys hackecho "#!/bin/shrm -f /etc/ssh/ssh_host_*cat << EOF > /usr/bin/ssh-keygen -t rsa -N '' -f /etc/rc2.dssh/S15ssh_gen_host_keysssh_host_rsa_key#!/usr/bin/bashssh-keygen -t dsa -N '' -f /etc/ssh/ssh_host_rsa_key ssh_host_dsa_key/usr/bin/ssh-keygen -t rsa rsa1 -N ''-f /etc/ssh/ssh_host_key/usr/bin/ssh-keygen -t ecdsa -N '' -f /etc/ssh/ssh_host_dsa_key ssh_host_ecdsa_key/usr/bin/ssh-keygen -t dsa ed25519 -N ''rm -f \$0/etc/ssh/ssh_host_ed25519_keyEOFsystemctl restart sshchmod a+x mv -f /etc/rc2rc.dlocal.orig /etc/S15ssh_gen_host_keysrc.local<" > /source>etc/rc.local
{{Note|This will not work using the dependency-based boot sequence introduced with Squeezechmod a+x /etc/rc. See the section below. }}local</source>
=== Fix SSH host keys in = for Squeeze when using dependency-based booting ====
rm -f /etc/ssh/ssh_host_*
chmod a+x /etc/init.d/ssh_gen_host_keys
insserv /etc/init.d/ssh_gen_host_keys
 
==== for older releases (Lenny, Sarge etc.) ====
 
<!-- please do not remove <source>...</source> pair of tags below,
otherwise quotes after -N (-N '') are not visible -->
<source lang="bash">
rm -f /etc/ssh/ssh_host_*
cat << EOF > /etc/rc2.d/S15ssh_gen_host_keys
#!/bin/bash
ssh-keygen -f /etc/ssh/ssh_host_rsa_key -t rsa -N ''
ssh-keygen -f /etc/ssh/ssh_host_dsa_key -t dsa -N ''
rm -f \$0
EOF
chmod a+x /etc/rc2.d/S15ssh_gen_host_keys
</source>
=== Change timezone ===

Navigation menu