#!/sbin/sh echo "Settings permissions on /usr/local..." find /usr/local -exec chmod 755 {} \; chmod 700 /usr/local/etc/ssh_host_dsa_key chmod 600 /usr/local/etc/ssh_host_key chmod 600 /usr/local/etc/ssh_host_rsa_key #Make sure that /usr/local/bin is in the path for all logins. #Make sure that /usr/local/admin is in the path for root. #As root run: if test -f /usr/local/etc/ssh_host_key then echo "rsa1 host key already generated...skipping" else ssh-keygen -t rsa1 -f /usr/local/etc/ssh_host_key -N "" fi if test -f /usr/local/etc/ssh_host_dsa_key then echo "dsa host key already generated...skipping" else ssh-keygen -t dsa -f /usr/local/etc/ssh_host_dsa_key -N "" fi if test -f /usr/local/etc/ssh_host_rsa_key then echo "rsa host key already generated...skipping" else ssh-keygen -t rsa -f /usr/local/etc/ssh_host_rsa_key -N "" fi echo "Settings permissions on /usr/local..." find /usr/local -exec chmod 755 {} \; chmod 700 /usr/local/etc/ssh_host_dsa_key chmod 600 /usr/local/etc/ssh_host_key chmod 600 /usr/local/etc/ssh_host_rsa_key ln -s /usr/local/bin/ssh /usr/local/bin/slogin ln -s /usr/local/man/man1/ssh.1 /usr/local/man/man1/slogin.1 cp /usr/local/etc/ssh_config.example /usr/local/etc/ssh_config cp /usr/local/etc/sshd_config.example /usr/local/etc/sshd_config # add sshd user and group /bin/mkdir /var/chroot /bin/mkdir /var/chroot/sshd /bin/chown root:sys /var/chroot /bin/chown root:sys /var/chroot/sshd /bin/chmod 755 /var/chroot/sshd /usr/sbin/groupadd -g 5101 sshd /usr/sbin/useradd -d /var/chroot/sshd -g sshd -u 5101 -m sshd /bin/chown sshd /var/chroot/sshd /bin/chgrp sshd /var/chroot/sshd /bin/id sshd #setup start script chmod +x /etc/init.d/sshd ln -s /etc/init.d/sshd /etc/rc2.d/S77sshd #Get it started: echo "OpenSSH version:" echo " " ssh -V echo " " echo "has now been installled." echo " " echo "type: /etc/rc2.d/S77sshd start to start up your server"