[f45b1953] | 1 | <sect2>
|
---|
| 2 | <title>Configuring OpenSSH</title>
|
---|
| 3 |
|
---|
| 4 | <sect3><title>Config files</title>
|
---|
| 5 |
|
---|
| 6 | <para><userinput>/etc/ssh/ssh_config, /etc/ssh/sshd_config </userinput></para>
|
---|
| 7 | <para>There are no required changes in either of these files. However
|
---|
| 8 | you may wish to view them to make changes for appropriate security to
|
---|
| 9 | your system. Configuration information can be found in the man pages for sshd, ssh and ssh-agent</para>
|
---|
| 10 | </sect3>
|
---|
| 11 |
|
---|
| 12 | <sect3><title>sshd init.d script</title>
|
---|
| 13 |
|
---|
| 14 | <para>Note that you only want to start the sshd server if you want to be
|
---|
| 15 | able to ssh <emphasis>into</emphasis> your machine. The ssh client
|
---|
| 16 | doesn't need this script to be used. Having said that, if you want to
|
---|
| 17 | run the ssh daemon, the sshd init.d script can be created using the following
|
---|
| 18 | commands:</para>
|
---|
| 19 |
|
---|
| 20 | <para><screen><userinput>cat > /etc/rc.d/init.d/sshd << "EOF"</userinput>
|
---|
| 21 | #!/bin/sh
|
---|
| 22 | # Begin $rc_base/init.d/sshd
|
---|
| 23 |
|
---|
| 24 | # Based on sysklogd script from LFS-3.1 and earlier.
|
---|
| 25 | # Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
|
---|
| 26 |
|
---|
| 27 | source /etc/sysconfig/rc
|
---|
| 28 | source $rc_functions
|
---|
| 29 |
|
---|
| 30 | case "$1" in
|
---|
| 31 | start)
|
---|
| 32 | echo "Starting SSH Server..."
|
---|
| 33 | loadproc sshd
|
---|
| 34 | ;;
|
---|
| 35 |
|
---|
| 36 | stop)
|
---|
| 37 | echo "Stopping SSH Server..."
|
---|
| 38 | killproc sshd
|
---|
| 39 | ;;
|
---|
| 40 |
|
---|
| 41 | reload)
|
---|
| 42 | echo "Reloading SSH Server..."
|
---|
| 43 | reloadproc sshd
|
---|
| 44 | ;;
|
---|
| 45 |
|
---|
| 46 | restart)
|
---|
| 47 | $0 stop
|
---|
| 48 | sleep 1
|
---|
| 49 | $0 start
|
---|
| 50 | ;;
|
---|
| 51 |
|
---|
| 52 | status)
|
---|
| 53 | statusproc sshd
|
---|
| 54 | ;;
|
---|
| 55 |
|
---|
| 56 | *)
|
---|
| 57 | echo "Usage: $0 {start|stop|reload|restart|status}"
|
---|
| 58 | exit 1
|
---|
| 59 | ;;
|
---|
| 60 | esac
|
---|
| 61 |
|
---|
| 62 | # End $rc_base/init.d/sshd
|
---|
| 63 | <userinput>EOF
|
---|
| 64 | chmod 755 /etc/rc.d/init.d/sshd</userinput></screen></para>
|
---|
| 65 |
|
---|
| 66 | <para>Create the symbolic links to this file in the relevant rc.d directories with the following commands:
|
---|
| 67 | <screen><userinput>cd /etc/rc.d/init.d &&
|
---|
| 68 | ln -sf ../init.d/sshd ../rc0.d/K30sshd &&
|
---|
| 69 | ln -sf ../init.d/sshd ../rc1.d/K30sshd &&
|
---|
| 70 | ln -sf ../init.d/sshd ../rc2.d/K30sshd &&
|
---|
| 71 | ln -sf ../init.d/sshd ../rc3.d/S30sshd &&
|
---|
| 72 | ln -sf ../init.d/sshd ../rc4.d/S30sshd &&
|
---|
| 73 | ln -sf ../init.d/sshd ../rc5.d/S30sshd &&
|
---|
| 74 | ln -sf ../init.d/sshd ../rc6.d/K30sshd</userinput></screen></para>
|
---|
| 75 |
|
---|
| 76 | </sect3>
|
---|
| 77 |
|
---|
| 78 | </sect2>
|
---|
| 79 |
|
---|