Enabling SSH under FreeBSD
Anyone that’s diddled around with SSH under FreeBSD will be all too familiar with this error message when trying to start the SSH daemon directly:
fbsd1# /usr/sbin/sshd
Could not load host key: /etc/ssh/ssh_host_dsa_key
Disabling protocol version 2. Could not load host key
sshd: no hostkeys available — exiting.
fbsd1#
To keep it happy, you could generate /etc/ssh/ssh_host_dsa_key
manually by using ssh_keygen (as you used to in previous FreeBSD releases) - but a much more straight forward way of
enabling it now exists. All you have to do is to edit /etc/rc.conf and tag on this line:
sshd_enable=”YES”
Next time the system starts, it’ll automatically generate any
necessary keys for you and start accepting SSH requests. If you’re
of the impatient type and want SSH to start right now, use this:
killall sshd
/etc/rc.d/sshd start
And that’s it!
Did you find this hint useful? Are you looking to learn more? Well, here’s a few books that I’ve found useful – have a goosie!
![]() Absolute FreeBSD: The Complete Guide |
![]() FreeBSD unleashed |
![]() Design and Implementation of FreeBSD |
![]() The Best of FreeBSD Basics |





