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