mirror of
https://github.com/Zeckmathederg/glfs.git
synced 2025-02-04 07:17:15 +08:00
f45b195302
git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@3 af4574ff-66df-0310-9fd7-8a98e5e911e0
80 lines
2.1 KiB
XML
80 lines
2.1 KiB
XML
<sect2>
|
|
<title>Configuring OpenSSH</title>
|
|
|
|
<sect3><title>Config files</title>
|
|
|
|
<para><userinput>/etc/ssh/ssh_config, /etc/ssh/sshd_config </userinput></para>
|
|
<para>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</para>
|
|
</sect3>
|
|
|
|
<sect3><title>sshd init.d script</title>
|
|
|
|
<para>Note that you only want to start the sshd server if you want to be
|
|
able to ssh <emphasis>into</emphasis> 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:</para>
|
|
|
|
<para><screen><userinput>cat > /etc/rc.d/init.d/sshd << "EOF"</userinput>
|
|
#!/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
|
|
<userinput>EOF
|
|
chmod 755 /etc/rc.d/init.d/sshd</userinput></screen></para>
|
|
|
|
<para>Create the symbolic links to this file in the relevant rc.d directories with the following commands:
|
|
<screen><userinput>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</userinput></screen></para>
|
|
|
|
</sect3>
|
|
|
|
</sect2>
|
|
|