[dcc89bf1] | 1 | <sect2>
|
---|
[8936be4] | 2 | <title>Setting up a <acronym>CVS</acronym> server.</title>
|
---|
[dcc89bf1] | 3 |
|
---|
[8936be4] | 4 | <para>We will discuss setting up a <acronym>CVS</acronym> server using OpenSSH
|
---|
| 5 | as the remote access method. Other access methods, including :pserver: and
|
---|
| 6 | :server: will not be used for write access to the <acronym>CVS</acronym>
|
---|
| 7 | repository. The :pserver: method sends clear text passwords over the network
|
---|
| 8 | and the :server: method is not supported in all <acronym>CVS</acronym> ports.
|
---|
| 9 | Instructions for anonymous, read only <acronym>CVS</acronym> access using
|
---|
| 10 | :pserver: can be found at the end of this section.</para>
|
---|
[dcc89bf1] | 11 |
|
---|
[8936be4] | 12 | <para>Configuration of our <acronym>CVS</acronym> server consists of four
|
---|
| 13 | steps:</para>
|
---|
[dcc89bf1] | 14 |
|
---|
| 15 | <sect3><title>1. Create a repository.</title>
|
---|
[8936be4] | 16 | <para>Create a new <acronym>CVS</acronym> repository with the following
|
---|
| 17 | commands, logged in as root:</para>
|
---|
| 18 | <screen><userinput><command>mkdir /cvsroot &&
|
---|
[dcc89bf1] | 19 | chmod 1777 /cvsroot &&
|
---|
[677a0f7] | 20 | export CVSROOT=/cvsroot &&
|
---|
[8936be4] | 21 | cvs init</command></userinput></screen></sect3>
|
---|
[dcc89bf1] | 22 |
|
---|
| 23 | <sect3><title>2. Import source code into the repository.</title>
|
---|
| 24 | <para>Import a source module into the repository with the following
|
---|
[8936be4] | 25 | commands, issued from a user account on the same machine as the
|
---|
| 26 | <acronym>CVS</acronym> repository:</para>
|
---|
[dcc89bf1] | 27 |
|
---|
[8936be4] | 28 | <screen><userinput><command>export CVSROOT=/cvsroot &&
|
---|
[dcc89bf1] | 29 | cd sourcedir &&
|
---|
[8936be4] | 30 | cvs import -m "repository test" cvstest vendortag releasetag</command></userinput></screen></sect3>
|
---|
[dcc89bf1] | 31 |
|
---|
| 32 | <sect3><title>3. Verify local repository access.</title>
|
---|
[8936be4] | 33 | <para>Test access to the <acronym>CVS</acronym> repository from the same user
|
---|
| 34 | account with the following command:</para>
|
---|
[dcc89bf1] | 35 |
|
---|
[8936be4] | 36 | <screen><userinput><command>cvs co cvstest</command></userinput></screen></sect3>
|
---|
[dcc89bf1] | 37 |
|
---|
| 38 | <sect3><title>4. Verify remote repository access.</title>
|
---|
[8936be4] | 39 | <para>Test access to the <acronym>CVS</acronym> repository from a remote
|
---|
| 40 | machine using a user account that has <command>ssh</command> access to the
|
---|
| 41 | <acronym>CVS</acronym> server with the following commands:
|
---|
| 42 | <note><para>Replace "servername" with the <acronym>IP</acronym> address or host
|
---|
| 43 | name ofthe <acronym>CVS</acronym> repository machine. You will be prompted for
|
---|
| 44 | the user's shellaccount password before <acronym>CVS</acronym> checkout can
|
---|
[dcc89bf1] | 45 | continue.</para></note></para>
|
---|
| 46 |
|
---|
| 47 |
|
---|
[8936be4] | 48 | <screen><userinput><command>export CVS_RSH=/usr/bin/ssh &&
|
---|
[ca89a835] | 49 | cvs -d:ext:<replaceable>servername</replaceable>:/cvsroot co cvstest</command></userinput></screen></sect3>
|
---|
[dcc89bf1] | 50 | </sect2>
|
---|
| 51 | <sect2>
|
---|
[8936be4] | 52 | <title>Configuring <acronym>CVS</acronym> for anonymous read only access.</title>
|
---|
[dcc89bf1] | 53 |
|
---|
[8936be4] | 54 | <para><acronym>CVS</acronym> can be set up to allow anonymous read only access
|
---|
| 55 | using the :pserver: method by logging on as root and executing the following
|
---|
[dcc89bf1] | 56 | commands:</para>
|
---|
| 57 |
|
---|
[8936be4] | 58 | <screen><userinput><command>(grep anonymous /etc/passwd || useradd anonymous -s /bin/false) &&
|
---|
[677a0f7] | 59 | echo anonymous: > /cvsroot/CVSROOT/passwd &&
|
---|
[8936be4] | 60 | echo anonymous > /cvsroot/CVSROOT/readers</command></userinput></screen>
|
---|
[dcc89bf1] | 61 |
|
---|
[8936be4] | 62 | <para>If you use <command>inetd</command>, the following command will add the
|
---|
| 63 | pserver entry to <filename>/etc/inetd.conf</filename>:</para>
|
---|
[dcc89bf1] | 64 |
|
---|
[8936be4] | 65 | <screen><userinput><command>echo "2401 stream tcp nowait root /usr/bin/cvs cvs -f \
|
---|
| 66 | --allow-root=/cvsroot pserver" >> /etc/inetd.conf</command></userinput></screen>
|
---|
[dcc89bf1] | 67 |
|
---|
[8936be4] | 68 | <para>Issue a <command>killall -HUP inetd</command> to reread the changed
|
---|
| 69 | <filename>inetd.conf</filename> file.</para>
|
---|
[dcc89bf1] | 70 |
|
---|
[8936be4] | 71 | <para>If you use <command>xinetd</command>, the following command will add the
|
---|
| 72 | pserver entry to <filename>/etc/xinetd.conf</filename>:</para>
|
---|
[dcc89bf1] | 73 |
|
---|
[8936be4] | 74 | <screen><userinput><command>cat >> /etc/xinetd.conf << "EOF"</command>
|
---|
[dcc89bf1] | 75 | service cvspserver
|
---|
| 76 | {
|
---|
| 77 | port = 2401
|
---|
| 78 | socket_type = stream
|
---|
| 79 | protocol = tcp
|
---|
| 80 | wait = no
|
---|
| 81 | user = root
|
---|
| 82 | passenv = PATH
|
---|
| 83 | server = /usr/bin/cvs
|
---|
| 84 | server_args = -f --allow-root=/cvsroot pserver
|
---|
| 85 | }
|
---|
[8936be4] | 86 | <command>EOF</command></userinput></screen>
|
---|
| 87 | <para>Issue a <command>killall -HUP xinetd</command> to reread the changed
|
---|
| 88 | <filename>xinetd.conf</filename> file.</para>
|
---|
[dcc89bf1] | 89 |
|
---|
| 90 | <para>Testing anonymous access to the new repository requires an account
|
---|
[8936be4] | 91 | on another machine that can reach the <acronym>CVS</acronym> server via
|
---|
| 92 | network. No account on the <acronym>CVS</acronym> repository is needed. To
|
---|
| 93 | test anonymous access to the <acronym>CVS</acronym> repository log in to
|
---|
| 94 | another machine as an unprivileged user and execute the following command:
|
---|
| 95 | </para>
|
---|
| 96 |
|
---|
[ca89a835] | 97 | <screen><userinput><command>cvs -d:pserver:anonymous@<replaceable>servername</replaceable>:/cvsroot co cvstest</command></userinput></screen>
|
---|
[8936be4] | 98 | <note><para>Replace "servername" with the <acronym>IP</acronym> address or
|
---|
[a75063d4] | 99 | hostname of the <acronym>CVS</acronym> server</para></note>
|
---|
[dcc89bf1] | 100 |
|
---|
| 101 | </sect2>
|
---|
| 102 |
|
---|
| 103 |
|
---|