The following steps must be done as root.
Install openssh, using pkgin.
# pkgin install openssh installing openssh-5.x... openssh-5.x: rebuilding run-time library search paths database openssh-5.x: copying /usr/pkg/share/examples/rc.d/sshd to /usr/pkg/etc/rc.d/sshd openssh-5.x: copying /usr/pkg/share/examples/openssh/moduli to /usr/pkg/etc/ssh/moduli openssh-5.x: copying /usr/pkg/share/examples/openssh/ssh_config to /usr/pkg/etc/ssh/ssh_config openssh-5.x: copying /usr/pkg/share/examples/openssh/sshd_config to /usr/pkg/etc/ssh/sshd_config
Customize daemon settings in /usr/pkg/etc/ssh/sshd_config if desired.
- Easy way:
Reboot -- the security keys will be created, and sshd will be started automatically, because pkgin installs the script rc.d/sshd.
- Manual way:
Create ssh_host_key, ssh_host_rsa_key, and ssh_host_dsa_key files in /usr/pkg/etc/ssh/.
# ssh-keygen -t rsa1 # ssh-keygen -t rsa # ssh-keygen -t dsa
Start the sshd dæmon.
# /usr/pkg/sbin/sshd
- Test a connection into your machine.
If it does not work, check if the sshd daemon is running and listening to the appropriate port.
# ps ax | grep sshd # tcpstat -a | grep ssh