3 # sshd sshd (secure shell daemon)
7 # description: sshd (secure shell daemon) is a server part of the ssh suite.
8 # Ssh can be used for remote login, remote file copying, TCP port
9 # forwarding etc. Ssh offers strong encryption and authentication.
12 # Source function library
13 . /etc/rc.d/init.d/functions
16 . /etc/sysconfig/network
19 [ -f /etc/sysconfig/sshd ] && . /etc/sysconfig/sshd
21 # Check that networking is up.
22 if is_no "${NETWORKING}"; then
23 msg_Network_Down OpenSSH
28 # See how we were called.
31 # Check if the service is already running?
32 if [ ! -f /etc/ssh/ssh_host_key ]; then
33 msg_Not_Running OpenSSH
34 nls "No SSH host key found! You must run \"$0 init\" first."
37 if [ ! -f /var/lock/subsys/sshd ]; then
39 daemon /usr/sbin/sshd -h /etc/ssh/ssh_host_key
41 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/sshd
43 msg_Already_Running OpenSSH
47 if [ -f /var/lock/subsys/sshd ]; then
50 rm -f /var/run/sshd.pid /var/lock/subsys/sshd >/dev/null 2>&1
52 msg_Not_Running OpenSSH
65 echo "Now the SSH host key will be generated. Please note, that if you"
66 echo "will use password for the key, you will need to type it on each"
68 ssh-keygen -f /etc/ssh/ssh_host_key
72 msg_Usage "$0 {start|stop|status|restart}"