# Setting up a CVS Server

## CrazyManDann

Heya,

I'm almost totally a linux n00by, and in true n00by fashion I'm trying to run before I can walk  :Rolling Eyes: 

I currenlty have a gentoo server (sitting quietly under my stairs  :Mr. Green:  ) which I access using putty from my windows laptop. I've installed cvs and xinetd and they seem to startup ok when the machine boots.

I think that I also managed to set up a repository for cvs at /usr/local/cvsroot, though typing echo $CVSROOT returns nothing, so I don't think that the environment variable for CVSROOT has been set up.

I'm also lost on how to create user's and their passwords ... I think that I read somewhere that there is a config file to edit ... but that doesn't seem right for passwords, especially as they shouldn't be plain text. :Shocked: 

So, can anybody help or point me at a fairly good source for info?

Cheers guys

~Dann

----------

## fraterm

It would be nice if there was a concise noob level cvs server setup howto... 

One method of setting up servers that I've seen is to set up another directory in which a cvs binary is "jailed" this way you can isolate any compromise of that binary to the served directory itself rather than your entire system.

There are about 256 different ways of setting up a cvs server though... and not alot of help setting them up.

----------

## fyerk

Have you looked at the CVS Book?

http://cvsbook.red-bean.com/cvsbook.html

----------

## bus_drivr

You have probably been successful in setting up user accounts by now. However

there is an easy to use script called superadduser that simplifies the process. I have used it almost exclusively since using linux. 

 emerge superadduser and give it a whirl. Hope this helps.

 When you complete your cvs setup please leave the steps you used as a guide to others.

 I would like to see others post to this thread with some recommendations.

 I find the cvs documentation to be somewhat obtuse. 

 Also have noted in the docs some use data/cvsroot. advanatges? databse searches 

for code in cvsroot?

----------

## Ekimus

Ok heres my setup:

(honestly stolen from: http://www.taursys.com/howto/cvs/)

First i did:

(all of this as root)

```
emerge cvs
```

You now already have the server installed, and should have a file called /etc/xinetd.d/cvspserver.

Just do one thing change the line

```
disable = yes
```

to

```
disable = no
```

For me it was also necessary to emerge xinetd.conf because I had no need for it before.

```
emerge xinetd
```

Then depending on wether you want it automatically started either add it to your default runlevel

```
rc-update add xinetd default
```

or if you want to start it manually

```
/etc/init.d/xinetd start
```

actually you have to do this anyway (the first time to set up your repository) DON'T DO THAT NOW I will tell you when to do.

Now we'll create the repository

```

cvs -d /var/cvsroot init

chown -R cvs.cvs /var/cvsroot

```

Now well make a perl script which will output an encrypted password

```

#!/usr/bin/perl

srand (time());

my $randletter = "(int (rand (26)) + (int (rand (1) + .5) % 2 ? 65 : 97))";

my $salt = sprintf ("%c%c", eval $randletter, eval $randletter);

my $plaintext = shift;

my $crypttext = crypt ($plaintext, $salt);

print "${crypttext}\n";

```

Syntax is

```

cvspasswd.pl password

```

output will be the encrypted password which you will need just in a second

No go to /var/cvsroot/CVSROOT

and make a textfile called 'passwd'

```

cd /var/cvsroot/CVSROOT

touch passwd

```

it has the following format

```

user1:<encrypted password from cvspasswd.pl here>:cvs

user2:<encrypted password from cvspasswd.pl here>:cvs

```

now set the permissions in that file

```

chmod 400 /var/cvsroot/CVSROOT/passwd

```

Now we are go

start xinetd now

```

/etc/init.d/xinetd start

```

(from here as a normal user)

```

export CVSROOT=:pserver:username1@localhost:/var/cvsroot

cvs login

```

Now fill in the password you entered in /var/cvsroot/CVSROOT/passwd

You can use ":ext:username@host:/var/cvsroot" to use ssh instead of plaintext which cvs uses, in this case you also have to add a variable 'CVS_RSH="/usr/bin/ssh"' to your environment

(I recommend setting this in /etc/env.d/....)

Here goes our first test project:

```

cd

mkdir testproj

echo "//Main Class">testproj/Main.java

cd testproj

cvs import -m "My initial project message" testproj mycompany start

```

Check to make sure the project was created in the repository. You should see the file Main.java in /usr/local/cvsroot/testproj

You are now a happy cvs server owner :)Last edited by Ekimus on Thu Jan 29, 2004 3:35 am; edited 1 time in total

----------

## brain__fear

Use CVSD, emerge cvsd.

Then download the source from here: http://tiefighter.et.tudelft.nl/~arthur/cvsd/

To get the setup instructions.

----------

## Ekimus

I read that but you need a working cvs to be able to configure cvsd (at least that's what I read from some howtos)

Actually what I'm searching for is something like ssh authentication, I couldn't find any good documentation about it by now, to me it's quite annoying that I always have to type the password, I read something about tunneling thru ssh but couldn't get it up, well anyway it's nearly 0500 am.

----------

## georwell

check out the environment variable CVS_RSH=ssh

----------

