Excerpts from Jon's message of Mon Oct 17 23:27:30 UTC 2011: > Hello Clint, > > >> sshd is no longer started and/or stopped with /etc/init.d/ssh unless you > >> are running inside a chroot. > I'm new to upstart, so forgive my ignorance, but I thought upstart still used > the init scripts to start and/or stop the jobs. >
No, upstart jobs are designed to be short and pointed ways to define how a daemon starts and stops. /etc/init.d is only for backward compatibility in an upstart system. The ssh init.d script was left the way it is because of chroot jails for sshd, but it is not necessary for normal operation. > >> The host keys are typically generated in the postinstall script of > >> openssh-server. > I think this may be the issue. > > >> So if you don't have keys, its likely that something went wrong during > >> that process. > Well, I suppose this is true, but in this particular case, I intentionally > remove them as a final step to prepare a base image for use with QEMU-KVM. > It is a security concern to have multiple guest VMs all running with the same > SSH key. > > >> Try this to remedy the situation. > >> sudo apt-get install openssh-server --reinstall > Two things, > > 1) Why not: > dpkg-reconfigure openssh-server > As this seems to be a more direct route? Again, maybe I'm not seeing all of > the pieces. Yeah, thats probably better. What was I thinking? ;) > > 2) In the Development environment both of these solutions will work, > however, this is not scalable and is not a viable solution in a > production environment. > Not sure why this isn't scalable... its not that heavy of a command and it should be idempotent. > Thanks for your quick response. As is my experience with other non- > upstart distros, SSH automatically creates these host keys if they don't > exist, it is my strong personal belief that Ubuntu should not deviate > from the norm for two reasons, first to remain consistent with 'Linux' > (other distros) , and second so I can present a viable solution to my > management using an Ubuntu platform. Please let me know if you think I'm > way off here, I really do appreciate the assistance. > I do think its a bit odd that they are generated at install time rather than whenever they are missing, but either way, its a well defined behavior and so can be worked with fairly easily by removing and regenerating the keys at first boot. An upstart job like this would probably work: start on starting ssh task exec [ -f /etc/ssh/ssh_host_dsa_key ] || ssh-keygen -t dsa -b 4096 -f /etc/ssh/ssh_host_dsa_key -q -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/876910 Title: When starting open ssh server without host keys in /etc/ssh/, the keys are not automatically generated. To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/876910/+subscriptions -- ubuntu-bugs mailing list [email protected] https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
