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