Tagged cvsserver.xml

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@4356 af4574ff-66df-0310-9fd7-8a98e5e911e0
This commit is contained in:
Manuel Canales Esparcia 2005-05-18 18:55:21 +00:00
parent 66b825e081
commit 59bfedf5e4

View File

@ -7,96 +7,116 @@
]> ]>
<sect1 id="cvsserver" xreflabel="Running a CVS Server"> <sect1 id="cvsserver" xreflabel="Running a CVS Server">
<?dbhtml filename="cvsserver.html"?>
<sect1info> <sect1info>
<othername>$LastChangedBy$</othername> <othername>$LastChangedBy$</othername>
<date>$Date$</date> <date>$Date$</date>
</sect1info> </sect1info>
<?dbhtml filename="cvsserver.html"?> <title>Running a CVS Server</title>
<title>Running a CVS server</title>
<sect2> <sect2 role="package">
<title>Running a <acronym>CVS</acronym> server</title> <title>Running a CVS Server</title>
<para>This section will describe how to set up, administer and secure <para>This section will describe how to set up, administer and secure
a <acronym>CVS</acronym> server.</para> a CVS server.</para>
<bridgehead renderas="sect3">CVS Server Dependencies</bridgehead>
<bridgehead renderas="sect4">Required</bridgehead>
<para><xref linkend="cvs"/> and
<xref linkend="openssh"/></para>
</sect2>
<sect2 role="configuration">
<title>Setting up a CVS Server.</title>
<para>A CVS server will be set up using OpenSSH as the remote access
method. Other access methods, including :pserver: and :server: will
not be used for write access to the CVS repository. The :pserver:
method sends clear text passwords over the network and the :server:
method is not supported in all CVS ports. Instructions for anonymous,
read only CVS access using :pserver: can be found at the end of this
section.</para>
<para>Configuration of the CVS server consists of four
steps:</para>
<sect3> <sect3>
<title><application>CVS server</application> dependencies</title> <title>1. Create a Repository.</title>
<para>Create a new CVS repository with the following
commands:</para>
<screen role="root"><userinput>mkdir /srv/cvsroot &amp;&amp;
chmod 1777 /srv/cvsroot &amp;&amp;
export CVSROOT=/srv/cvsroot &amp;&amp;
cvs init</userinput></screen>
</sect3>
<sect3>
<title>2. Import Source Code Into the Repository.</title>
<para>Import a source module into the repository with the following
commands, issued from a user account on the same machine as the
CVS repository:</para>
<screen><userinput>cd <replaceable>[sourcedir]</replaceable> &amp;&amp;
cvs import -m "<replaceable>[repository test]</replaceable>" <replaceable>[cvstest]</replaceable> <replaceable>[vendortag]</replaceable> <replaceable>[releasetag]</replaceable></userinput></screen>
</sect3>
<sect3>
<title>3. Verify Local Repository Access.</title>
<para>Test access to the CVS repository from the same user
account with the following command:</para>
<screen><userinput>cvs co cvstest</userinput></screen>
</sect3>
<sect3>
<title>4. Verify Remote Repository Access.</title>
<para>Test access to the CVS repository from a remote machine using
a user account that has <command>ssh</command> access to the CVS
server with the following commands:</para>
<note>
<para>Replace <replaceable>[servername]</replaceable> with the
IP address or host name of the CVS repository machine. You will
be prompted for the user's shell account password before CVS
checkout can continue.</para>
</note>
<screen><userinput>export CVS_RSH=/usr/bin/ssh &amp;&amp;
cvs -d:ext:<replaceable>[servername]</replaceable>:/srv/cvsroot co cvstest</userinput></screen>
<sect4>
<title>Required</title>
<para><xref linkend="cvs"/> and <xref linkend="openssh"/></para></sect4>
</sect3> </sect3>
</sect2> </sect2>
<sect2> <sect2 id='cvsserver-config' role="configuration">
<title>Setting up a <acronym>CVS</acronym> server.</title> <title>Configuring CVS for Anonymous Read Only Access.</title>
<para>A <acronym>CVS</acronym> server will be set up using OpenSSH <para>CVS can be set up to allow anonymous read only access using the
as the remote access method. Other access methods, including :pserver: and :pserver: method by logging on as <systemitem class="username">root</systemitem>
:server: will not be used for write access to the <acronym>CVS</acronym> and executing the following commands:</para>
repository. The :pserver: method sends clear text passwords over the network
and the :server: method is not supported in all <acronym>CVS</acronym> ports.
Instructions for anonymous, read only <acronym>CVS</acronym> access using
:pserver: can be found at the end of this section.</para>
<para>Configuration of the <acronym>CVS</acronym> server consists of four <screen role="root"><userinput>(grep anonymous /etc/passwd || useradd anonymous -s /bin/false) &amp;&amp;
steps:</para>
<sect3><title>1. Create a repository.</title>
<para>Create a new <acronym>CVS</acronym> repository with the following
commands:</para>
<screen><userinput><command>mkdir /srv/cvsroot &amp;&amp;
chmod 1777 /srv/cvsroot &amp;&amp;
export CVSROOT=/srv/cvsroot &amp;&amp;
cvs init</command></userinput></screen></sect3>
<sect3><title>2. Import source code into the repository.</title>
<para>Import a source module into the repository with the following
commands, issued from a user account on the same machine as the
<acronym>CVS</acronym> repository:</para>
<screen><userinput><command>cd <replaceable>[sourcedir]</replaceable> &amp;&amp;
cvs import -m "<replaceable>[repository test]</replaceable>" <replaceable>[cvstest]</replaceable> <replaceable>[vendortag]</replaceable> <replaceable>[releasetag]</replaceable></command></userinput></screen></sect3>
<sect3><title>3. Verify local repository access.</title>
<para>Test access to the <acronym>CVS</acronym> repository from the same user
account with the following command:</para>
<screen><userinput><command>cvs co cvstest</command></userinput></screen></sect3>
<sect3><title>4. Verify remote repository access.</title>
<para>Test access to the <acronym>CVS</acronym> repository from a remote
machine using a user account that has <command>ssh</command> access to the
<acronym>CVS</acronym> server with the following commands:</para>
<note><para>Replace <replaceable>[servername]</replaceable> with the
<acronym>IP</acronym> address or host name of the <acronym>CVS</acronym>
repository machine. You will be prompted for the user's shell account password
before <acronym>CVS</acronym> checkout can continue.</para></note>
<screen><userinput><command>export CVS_RSH=/usr/bin/ssh &amp;&amp;
cvs -d:ext:<replaceable>[servername]</replaceable>:/srv/cvsroot co cvstest</command></userinput></screen></sect3>
</sect2>
<sect2 id='cvsserver-config'>
<title>Configuring <acronym>CVS</acronym> for anonymous read only access.</title>
<para><acronym>CVS</acronym> can be set up to allow anonymous read only access
using the :pserver: method by logging on as root and executing the following
commands:</para>
<screen><userinput><command>(grep anonymous /etc/passwd || useradd anonymous -s /bin/false) &amp;&amp;
echo anonymous: &gt; /srv/cvsroot/CVSROOT/passwd &amp;&amp; echo anonymous: &gt; /srv/cvsroot/CVSROOT/passwd &amp;&amp;
echo anonymous &gt; /srv/cvsroot/CVSROOT/readers</command></userinput></screen> echo anonymous &gt; /srv/cvsroot/CVSROOT/readers</userinput></screen>
<para>If you use <command>inetd</command>, the following command will add the <para>If you use <command>inetd</command>, the following command
<application><acronym>CVS</acronym></application> entry to <filename>/etc/inetd.conf</filename>:</para> will add the <application>CVS</application> entry to
<filename>/etc/inetd.conf</filename>:</para>
<screen><userinput><command>echo "2401 stream tcp nowait root /usr/bin/cvs cvs -f \ <screen role="root"><userinput>echo "2401 stream tcp nowait root /usr/bin/cvs cvs -f \
--allow-root=/srv/cvsroot pserver" &gt;&gt; /etc/inetd.conf</command></userinput></screen> --allow-root=/srv/cvsroot pserver" &gt;&gt; /etc/inetd.conf</userinput></screen>
<indexterm zone="cvsserver cvsserver-config"> <indexterm zone="cvsserver cvsserver-config">
<primary sortas="e-etc-inetd.conf">/etc/inetd.conf</primary> <primary sortas="e-etc-inetd.conf">/etc/inetd.conf</primary>
@ -105,11 +125,11 @@ echo anonymous &gt; /srv/cvsroot/CVSROOT/readers</command></userinput></screen>
<para>Issue a <command>killall -HUP inetd</command> to reread the changed <para>Issue a <command>killall -HUP inetd</command> to reread the changed
<filename>inetd.conf</filename> file.</para> <filename>inetd.conf</filename> file.</para>
<para>If you use <command>xinetd</command>, the following command will create the <para>If you use <command>xinetd</command>, the following command will create
<acronym>CVS</acronym> file as <filename>/etc/xinetd.d/cvspserver</filename>:</para> the CVS file as <filename>/etc/xinetd.d/cvspserver</filename>:</para>
<screen><userinput><command>cat &gt;&gt; /etc/xinetd.d/cvspserver &lt;&lt; "EOF"</command> <screen role="root"><userinput>cat &gt;&gt; /etc/xinetd.d/cvspserver &lt;&lt; "EOF"
# Begin /etc/xinetd.d/cvspserver <literal># Begin /etc/xinetd.d/cvspserver
service cvspserver service cvspserver
{ {
@ -123,71 +143,74 @@ echo anonymous &gt; /srv/cvsroot/CVSROOT/readers</command></userinput></screen>
server_args = -f --allow-root=/srv/cvsroot pserver server_args = -f --allow-root=/srv/cvsroot pserver
} }
# End /etc/xinetd.d/cvspserver # End /etc/xinetd.d/cvspserver</literal>
<command>EOF</command></userinput></screen> EOF</userinput></screen>
<indexterm zone="cvsserver cvsserver-config"> <indexterm zone="cvsserver cvsserver-config">
<primary sortas="e-etc-xinetd.d-cvspserver">/etc/xinetd.d/cvspserver</primary> <primary sortas="e-etc-xinetd.d-cvspserver">/etc/xinetd.d/cvspserver</primary>
</indexterm> </indexterm>
<para>Issue a <command>/etc/rc.d/init.d/xinetd reload</command> to reread the changed <para>Issue a <command>/etc/rc.d/init.d/xinetd reload</command> to reread
<filename>xinetd.conf</filename> file.</para> the changed <filename>xinetd.conf</filename> file.</para>
<para>Testing anonymous access to the new repository requires an account <para>Testing anonymous access to the new repository requires an account
on another machine that can reach the <acronym>CVS</acronym> server via on another machine that can reach the CVS server via network. No account
network. No account on the <acronym>CVS</acronym> repository is needed. To on the CVS repository is needed. To test anonymous access to the CVS
test anonymous access to the <acronym>CVS</acronym> repository, log in to repository, log in to another machine as an unprivileged user and execute
another machine as an unprivileged user and execute the following command: the following command:</para>
</para>
<screen><userinput><command>cvs -d:pserver:anonymous@<replaceable>[servername]</replaceable>:/srv/cvsroot co cvstest</command></userinput></screen> <screen><userinput>cvs -d:pserver:anonymous@<replaceable>[servername]</replaceable>:/srv/cvsroot co cvstest</userinput></screen>
<note><para>Replace <replaceable>[servername]</replaceable> with the <note>
<acronym>IP</acronym> address or hostname of the <para>Replace <replaceable>[servername]</replaceable> with the
<acronym>CVS</acronym> server.</para></note> IP address or hostname of the CVS server.</para>
</note>
</sect2> </sect2>
<sect2> <sect2 role="commands">
<title>Command explanations</title> <title>Command Explanations</title>
<para><command>mkdir /srv/cvsroot</command>: Create the <acronym>CVS</acronym> <para><command>mkdir /srv/cvsroot</command>: Create the CVS
repository directory.</para> repository directory.</para>
<para><command>chmod 1777 /srv/cvsroot</command>: Set sticky bit permissions for <para><command>chmod 1777 /srv/cvsroot</command>: Set sticky bit
<envar>CVSROOT</envar>.</para> permissions for <envar>CVSROOT</envar>.</para>
<para><command>export CVSROOT=/srv/cvsroot</command>: Specify new <envar>CVSROOT <para><command>export CVSROOT=/srv/cvsroot</command>: Specify new
</envar> for all <command>cvs</command> commands.</para> <envar>CVSROOT</envar> for all <command>cvs</command> commands.</para>
<para><command>cvs init</command>: Initialize the new <acronym>CVS</acronym> <para><command>cvs init</command>: Initialize the new CVS
repository.</para> repository.</para>
<para><command>cvs import -m "repository test" cvstest vendortag <para><command>cvs import -m "repository test" cvstest vendortag
releasetag</command>: All source code modules must be imported releasetag</command>: All source code modules must be imported into the
into the <acronym>CVS</acronym> repository before use, with the CVS repository before use, with the <command>cvs import</command> command.
<command>cvs import</command> command. The <userinput>-m</userinput> The <option>-m</option> flags specifies an initial descriptive entry for
flags specifies an initial descriptive entry for the new module. the new module. The <option>cvstest</option> parameter is the name used
The "cvstest" parameter is the name used for the module in all for the module in all subsequent <command>cvs</command> commands. The
subsequent <command>cvs</command> commands. The "vendortag" and "releasetag" <option>vendortag</option> and <option>releasetag</option> parameters are
parameters are used to further identify each <acronym>CVS</acronym> module and used to further identify each CVS module and are mandatory whether used
are mandatory whether used or not.</para> or not.</para>
<para><command>(grep anonymous /etc/passwd || useradd anonymous -s <para><command>(grep anonymous /etc/passwd || useradd anonymous -s
/bin/false)</command>: Check for an existing anonymous user and /bin/false)</command>: Check for an existing <systemitem
create one if not found.</para> class="username">anonymous</systemitem> user and create one if not
found.</para>
<para><command>echo anonymous: &gt; /srv/cvsroot/CVSROOT/passwd <para><command>echo anonymous: &gt; /srv/cvsroot/CVSROOT/passwd</command>:
</command>: Add the anonymous user to the <acronym>CVS</acronym> passwd file, Add the <systemitem class="username">anonymous</systemitem> user to the
which is unused for anything else in this configuration.</para> CVS passwd file, which is unused for anything else in this
configuration.</para>
<para><command>echo anonymous &gt; /srv/cvsroot/CVSROOT/readers</command>: Add the <para><command>echo anonymous &gt; /srv/cvsroot/CVSROOT/readers</command>:
anonymous user to the <acronym>CVS</acronym> readers file, a list of Add the <systemitem class="username">anonymous</systemitem> user to the
users who have read only access to the repository.</para> CVS readers file, a list of users who have read only access to the
repository.</para>
</sect2> </sect2>
<sect2> <sect2 role="content">
<title>Contents</title> <title>Contents</title>
<segmentedlist> <segmentedlist>
@ -201,6 +224,7 @@ users who have read only access to the repository.</para>
<seg>/srv/cvsroot</seg> <seg>/srv/cvsroot</seg>
</seglistitem> </seglistitem>
</segmentedlist> </segmentedlist>
</sect2> </sect2>
</sect1> </sect1>