Configuring OpenSSH
Config files
/etc/ssh/ssh_config, /etc/ssh/sshd_config
There are no required changes in either of these files. However
you may wish to view them to make changes for appropriate security to
your system. Configuration information can be found in the man pages for sshd, ssh and ssh-agent
sshd init.d script
Note that you only want to start the sshd server if you want to be
able to ssh into your machine. The ssh client
doesn't need this script to be used. Having said that, if you want to
run the ssh daemon, the sshd init.d script can be created using the following
commands:
cat > /etc/rc.d/init.d/sshd << "EOF"
#!/bin/sh
# Begin $rc_base/init.d/sshd
# Based on sysklogd script from LFS-3.1 and earlier.
# Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
source /etc/sysconfig/rc
source $rc_functions
case "$1" in
start)
echo "Starting SSH Server..."
loadproc sshd
;;
stop)
echo "Stopping SSH Server..."
killproc sshd
;;
reload)
echo "Reloading SSH Server..."
reloadproc sshd
;;
restart)
$0 stop
sleep 1
$0 start
;;
status)
statusproc sshd
;;
*)
echo "Usage: $0 {start|stop|reload|restart|status}"
exit 1
;;
esac
# End $rc_base/init.d/sshd
EOF
chmod 755 /etc/rc.d/init.d/sshd
Create the symbolic links to this file in the relevant rc.d directories with the following commands:
cd /etc/rc.d/init.d &&
ln -sf ../init.d/sshd ../rc0.d/K30sshd &&
ln -sf ../init.d/sshd ../rc1.d/K30sshd &&
ln -sf ../init.d/sshd ../rc2.d/K30sshd &&
ln -sf ../init.d/sshd ../rc3.d/S30sshd &&
ln -sf ../init.d/sshd ../rc4.d/S30sshd &&
ln -sf ../init.d/sshd ../rc5.d/S30sshd &&
ln -sf ../init.d/sshd ../rc6.d/K30sshd