178Chapter6 • Introduction to CVS
The easiest way to generate encrypted passwords for the password file is by using a simple
perl script. An example is presented below. Simply type this script into a file using a text editor
and make the file executable. Then run the program with two arguments, the username and the
password.
#!/usr/bin/perl
#
# Simple script to take a username and password and
# return a line suitable for pasting into the CVS
# password file.
#
($u, $p)=@ARGV;
@d=(A..Z,a..z);
$s=$d[rand(52)].$d[rand(52)];
print $u.":".crypt($p, $s).":cvs\n";
If you have saved the file under the name ‘
cvspassgen
’ and set the permission properly,
simple run the application as follows:
# ./cvspassgen username password
username:mU7OltQzHySmY:cvs
As you can see, the information is returned in the format that CVS requires. (Note: since a
random salt is used to generate the password, your output will vary from what is presented here.)
You can simply cut and paste the line into the password file. Another option is to redirect
the output of the script directly into the password file.
# ./cvspassgen username password >> $CVSROOT/CVSROOT/passwd
This assumes that the
$CVSROOT
environmental variable is set to the proper directory.
Next, the services file must be updated in order for the CVS server to respond to network
requests. The following line will append to the
/etc/services
file. Just be sure that there
are two “greater than” symbols or you will erase whatever is already in your services file.
# echo “cvspserver 2401/tcp” >> /etc/services
Next, the
inetd
server needs to know which service to start when requests come in.
RedHat 7.x uses the
xinetd
server and so a file needs to be created in
/etc/xinetd.d
named
cvspserver
.
Using your favorite text editor, edit /e
tc/xinetd.d/cvspserver
to include the fol-
lowing information:
# Description: cvspserver: version control system
service cvspserver
{
socket_type = stream
wait = no
user = cvs
Next Page >>
<< Previous Page
Back to the Table of Contents