OpenVZ Forum - RDF feed
type: channel
items: "S15ssh_gen_host_keys" script not executed after creating new container
items: Re: "S15ssh_gen_host_keys" script not executed after creating new container

"S15ssh_gen_host_keys" script not executed after creating new container
type: item
description: I've created a custom debian 6 template. I've followed these instructions: cat << EOF > /etc/rc2.d/S15ssh_gen_host_keys #!/bin/sh 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 But after creating a container, the ssh keys aren't generated. The official debian 6 template has a ssh_key_hack.sh?
creator: mgielissen
date: 2012-03-28T09:20:25-00:00

Re: "S15ssh_gen_host_keys" script not executed after creating new container
type: item
description: I've found the solution and it works: cat << EOF > /etc/init.d/ssh_gen_host_keys #!/bin/sh ### BEGIN INIT INFO # Provides: Generates new ssh host keys on first boot # Required-Start: $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Default-Start: 2 3 4 5 # Default-Stop: # Short-Description: Generates new ssh host keys on first boot # Description: Generates new ssh host keys on first boot ### END INIT INFO ssh-keygen -f /etc/ssh/ssh_host_rsa_key -t rsa -N "" ssh-keygen -f /etc/ssh/ssh_host_dsa_key -t dsa -N "" insserv -r /etc/init.d/ssh_gen_host_keys rm -f \$0 EOF chmod a+x /etc/init.d/ssh_gen_host_keys insserv /etc/init.d/ssh_gen_host_keys
creator: mgielissen
date: 2012-03-28T10:01:00-00:00