In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to install and configure the Fedora CVS server and create user groups. This article is very detailed and has a certain reference value. Friends who are interested must read it!
1. Fedora CVS server installation
First, make sure that the system has Fedora CVS server # rpm-qa | grep Fedora CVS server Fedora CVS server-1.11.22-9.fc7 if the command output is similar to the above output, the system already has a Fedora CVS server installed, otherwise you need to install the rpm package of the Fedora CVS server from the installation CD. But after installing Fedora7, the system installs the Fedora CVS server software on its own. Previous work: xinetd service is not installed on Fedora7 by default, so install xinetd service # yum install xinetd first
II. Configuration of Fedora CVS server side
1. Create Fedora CVS server groups and users
1) create a Fedora CVS server group
# / usr/sbin/groupadd Fedora CVS server
2) create a new user HOME directory
# mkdir / home/Fedora CVS server root
3) add a new user Fedora CVS server root, add it to the Fedora CVS server group, and specify its HOME directory
# / usr/sbin/useradd-g Fedora CVS Server-G Fedora CVS Server-d / home/Fedora CVS Server root Fedora CVS Server root
4) set the password of the Fedora CVS server root user. My password here is: chongqing
# passwd Fedora CVS server root Changing password for user Fedora CVS server root. New UNIX password: re-enter the new UNIX password: passwd: all authentication tokens updated successfully.
5) change the owner and group of the / home/Fedora CVS server root/ directory and its subdirectories
Because it is the directory among root users, his owner and group are both root. Here, we want to change the owner to Fedora CVS server root, and the group to Fedora CVS server to ensure that users of Fedora CVS server group have the appropriate permissions to this directory. # chown-R Fedora CVS Server root.Fedora CVS Server / home/Fedora CVS Server root/
6) change / home/Fedora CVS server root directory properties
Ensure that other users in the same group of Fedora CVS server root (Fedora CVS server group) also have read, write and execute rights. In the future, we will add user # chmod-R 775 / home/Fedora CVS server root/ to the Fedora CVS server group (Note: the following operations are performed as Fedora CVS server root)
two。 Switch to the Fedora CVS server root user and create a warehouse
1) switch users
# su Fedora CVS server root password: bash-3.2 $
2) set the global variable Fedora CVS server ROOT, and specify the directory where the warehouse is located
$export Fedora CVS Server ROOT=/home/Fedora CVS Server root/
3) create a warehouse
$Fedora CVS server init
OK, so far, you can submit the source code on the local machine as Fedora CVS server root.
3. Submit source code
1) enter the directory where the code you want to submit to the Fedora CVS server is located. Here is / home/HelloWorld/bash-3.2$ cd / home/HelloWorld/bash-3.2$ ls helloworld.cpp makefile to load the Fedora CVS server import-m "[repository test]" [Fedora CVS server test] [vendortag] [releasetag]-m in quotation marks, followed by the source code module name, then the loader, and finally the identifier. Here is:
2) submit the project
$Fedora CVS Server import-m "my Fedora CVS Server project" myProject Fedora CVS Server root start N myProject/makefile N myProject/helloworld.cpp No conflicts created by this import
At this point, our source code has also been submitted, indicating that module has been established. Its directory is: / home/Fedora CVS server root/myProject/
Ls-l / home/Fedora CVS server root total 20 drwxrwxr-x 3 Fedora CVS server root Fedora CVS server 4096 10-14 10:59 Fedora CVS server ROOT drwxrwxr-x 2 Fedora CVS server root Fedora CVS server 4096 10-14 12:11 myProject
3) checkout project
If we test under the root user (or other user, but must ensure that the user has write permission to the directory where the module is stored), and checkout gives this module, you can execute as follows:
# Fedora CVS Server-d / home/Fedora CVS Server root checkout myProject
Fedora CVS server checkout: Updating myProject
U myProject/helloworld.cpp
U myProject/makefile
It says that you can checkout locally, and it will automatically create a directory entry with that module name in the current directory, regardless of whether you checkout a source file or the entire module.
4. Create a user and password to log in to the Fedora CVS server
The Fedora CVS server uses system user login by default, and independent user management can also be used for the sake of system security. The Fedora CVS server username and password are saved in the passwd file in the Fedora CVS server ROOT directory in the format:
[Fedora CVS server username]: [encrypted password]: [equivalent system username]
1) create a passwd file first
$cd / home/Fedora CVS server root/Fedora CVS server ROOT/
$htpasswd-c passwd Fedora CVS server user
New password:
Re-type new password:
Adding password for user Fedora CVS Server user
$cat passwd
Fedora CVS Server user:R9oDKNeysScdw
$vi passwd
Add: Fedora CVS server root function is mapped to Fedora CVS server root user at the end. The final result is as follows: Fedora CVS server user:R9oDKNeysScdw:Fedora CVS server root creates other users without the parameter # htpasswd passwd username New password: Re-type new password:
To completely prevent login using the system account, edit the config file under the ROOT directory of the Fedora CVS server, remove the # before the line: # SystemAuth=yes, and change it to the following form: the SystemAuth=noFedora CVS server will not authenticate the system user, otherwise, when the user name is not in the passwd file, the Fedora CVS server will authenticate the system user.
2) configure read and write permissions for Fedora CVS server users
Use the readers and writers files in the ROOT directory of the Fedora CVS server to do this. These two files are not available by default, it doesn't matter, just create them yourself.
The readers file record has a user name with read-only permissions, one user per line, and the writers file record has a user name with read and write permission, which is also one user per line. Note that the readers file takes precedence over writers, which means that the user who appears in the readers will be read-only, regardless of whether the user exists in the writers file or not.
5. Set to boot and start the Fedora CVS server service
1) check whether the Fedora CVS server pserver is enabled in / etc/services. The Fedora CVS server pserver is the way to authenticate users when logging in to the Fedora CVS server remotely.
$cat / etc/services | grep Fedora CVS server pserver
Fedora CVS Server pserver 2401/tcp # Fedora CVS Server client/server operations
Fedora CVS Server pserver 2401/udp # Fedora CVS Server client/server operations
If the command output is similar to the above output, this means that my system has turned on the service.
2) create Fedora CVS server pserver file
Switch to root user:
# su root
Cd / etc/xinetd.d/
# vi Fedora CVS Server pserver
Edit the file as follows:
Service Fedora CVS Server pserver
{
Disable = no
Socket_type = stream
Wait = no
User = root
Server = / usr/bin/Fedora CVS server
Server_args =-f-- allow-root=/home/Fedora CVS server root pserver
Log_on_success + = USERID
Log_on_failure + = USERID
}
Where-- allow-root=/home/Fedora CVS server root is the directory where the warehouse is located.
Note: there should be a space on the left and right sides of the first "=" of each line.
3) then change the / etc/xinetd.d/Fedora CVS server
Otherwise, the following problems will occur when logging on to the machine remotely later
"there is no warehouse."
[test@liu ~] $Fedora CVS server-d: pserver:Fedora CVS server user@10.15.5.89:/home/Fedora CVS server root login Logging in to: pserver:Fedora CVS server user@10.15.5.89:2401/home/Fedora CVS server root Fedora CVS server password: / home/Fedora CVS server root: no such repository [test@liu ~] $
The change method is as follows:
Change disable=yes to disable=no; change the path in env and server_args to your Fedora CVS server root path. Mine is / home/Fedora CVS server root changed as follows
# default: off # description: The Fedora CVS server service can record the history of your source "# files. Fedora CVS server stores all the versions of a file in a single "# file in a clever way that only stores the differences" # between versions. Service Fedora CVS server pserver {disable = no port = 2401 socket_type = stream protocol = tcp wait = no user = root passenv = PATH server = / usr/bin/Fedora CVS server env = HOME=/home/Fedora CVS server root server_args =-f-- allow-root=/home/Fedora CVS server root pserver # bind = 127.0.0.1}
3) restart the xinetd service to make the configuration effective
Restart xinetd # / etc/init.d/xinetd restart stop xinetd: [OK] start xinetd: [OK] determine whether the Fedora CVS server pserver starts # netstat-l | grep Fedora CVS server pserver tcp 0 0 *: Fedora CVS server pserver *: * LISTEN
4) finally, you must check the settings of the firewall to see if port 2401 is open.
# / sbin/iptables-Lakestic GREP Fedora CVS server
If you see ACCEPT tcp-- anywhere anywhere tcp dpt:Fedora CVS server pserver indicates that the port is open, otherwise please open firewall port 2401
# / sbin/iptables-An INPUT-I eth0-p tcp-- dport 2401-j ACCEPT # / sbin/service iptables save
At this point, the Fedora CVS server configuration is complete, let's test it.
III. Client testing
1. Connect to the Fedora CVS server
The IP of the Fedora CVS server just established is: 10.15.5.89 client host uses non-root users. My user name is test. First, set up the environment variable Fedora CVS server ROOT and log in with the Fedora CVS server user Fedora CVS server user that you just established:
[test@liu ~] $export Fedora CVS Server ROOT=:pserver:Fedora CVS Server user@10.15.5.89:/home/Fedora CVS Server root [test@liu ~] $Fedora CVS Server login Logging in to: pserver:Fedora CVS Server user@10.15.5.89:2401/home/Fedora CVS Server root Fedora CVS Server password: [test@liu ~] $
If there is no error prompt, it means that you successfully logged in to the Fedora CVS server.
But it is very likely to appear here: unrecognized auth response from 10.15.5.89: Fedora CVS server pserver: cannot open / home/Fedora CVS server root/Fedora CVS server ROOT/config: Permission denied
Especially if you have a higher version of linux. This is due to selinux, which is a security mechanism that can be checked online. Just turn off selinux: edit / etc/selinux/config, set SELINUX to SELINUX=disabled, and disable SELINUX. Just restart the computer.
2. Check-out module
We have set up a warehouse above: myProject, we will checkout the module on the client side.
[test@liu ~] $Fedora CVS server checkout myProject
Fedora CVS server checkout: Updating myProject
U myProject/helloworld.cpp
U myProject/makefile
[test@liu ~] $
OK, the directory myProject has been generated under the current directory, and now you can go to myProject to modify, delete, submit and other operations.
Now let's talk about the establishment of multiple warehouses.
Note that we use the Fedora CVS server root for administrative purposes only, so don't create any repositories under it $HOME. In addition, the initial environment of the Fedora CVS server root user should not contain a non-empty $Fedora CVS server ROOT. (that is, environment variables must be set) any management work done with Fedora CVS server root indicates that Fedora CVS server ROOT is a good habit. OK, start building a warehouse for a single project, assuming that there are two projects, project1,project2, and want to store them separately for easy management.
1. Set up their own Fedora CVS server home directories for the two projects.
# mkdir / home/Fedora CVS server root/pro1
# mkdir / home/Fedora CVS server root/pro2
2. Change the owner and group of the pro1 and pro2 directories and their subdirectories respectively
# chown Fedora CVS Server root.Fedora CVS Server / home/Fedora CVS Server root/pro1
# chown Fedora CVS Server root.Fedora CVS Server / home/Fedora CVS Server root/pro2
3. Change the permissions of directories pro1 and pro2
# chmod 2775 / home/Fedora CVS Server root/pro1
# chmod 2775 / home/Fedora CVS Server root/pro2
(for higher security requirements, $chmod 2770 / home/Fedora CVS server root/pro1)
4. OK, start building the warehouse
# su Fedora CVS Server root
$Fedora CVS server-d / home/Fedora CVS server root/pro1 init
$Fedora CVS server-d / home/Fedora CVS server root/pro2 init
$chmod 2775 / home/Fedora CVS server root/pro1
$chmod 2775 / home/Fedora CVS server root/pro2
5. Modify the startup file
# vi / etc/xinetd.d/Fedora CVS server pserver
The contents are as follows:
Service Fedora CVS server pserver {disable = no socket_type = stream wait = no user = root server = / usr/bin/Fedora CVS server server_args =-f-- allow-root=/home/Fedora CVS server root/pro1-- allow-root=/home/Fedora CVS server root/pro2 pserver log_on_success + = USERID log_on_failure + = USERID}
Then change the / etc/xinetd.d/Fedora CVS server, otherwise, the following problem will occur when logging in remotely to this computer: "there is no such warehouse".
[test@liu ~] $Fedora CVS server-d: pserver:Fedora CVS server user@10.15.5.89:/home/Fedora CVS server root/pro1 login
Logging in to: pserver:Fedora CVS server user@10.15.5.89:2401/home/Fedora CVS server root/pro1
Fedora CVS server password:
/ home/Fedora CVS server root/pro1: no such repository
[test@liu ~] $
The change method is as follows: change disable=yes to disable=no; change the path in env and server_args to your Fedora CVS server root path. Mine is / home/Fedora CVS server root changed as follows
# default: off # description: The Fedora CVS server service can record the history of your source "# files. Fedora CVS server stores all the versions of a file in a single "# file in a clever way that only stores the differences" # between versions. Service Fedora CVS server pserver {disable = no port = 2401 socket_type = stream protocol = tcp wait = no user = root passenv = PATH server = / usr/bin/Fedora CVS server env = HOME=/home/Fedora CVS server root server_args =-f-allow-root=/home/Fedora CVS server root/pro1-- allow-root=/home/Fedora CVS server root/pro2 pserver # bind = 127.0.0.1}
6. Restart the xinetd service to make the configuration effective
Restart xinetd# / etc/init.d/xinetd restart
Stop xinetd: [OK]
Start xinetd: [OK]
7. Skills for building more warehouses
Because of the server_args length limit of xinetd, you can do this when you want to run a lot of single repositories.
1) modify Fedora CVS server pserver and Fedora CVS server file # vi / etc/xinetd.d/Fedora CVS server pserver#vi / etc/xinetd.d/Fedora CVS server
Modify them as follows:
Service Fedora CVS server pserver {disable = no socket_type = stream wait = no user = root server = / home/Fedora CVS server root/Fedora CVS server. Run log_on_success + = USERID log_on_failure + = USERID}
2) then write a script / home/Fedora CVS server root/Fedora CVS server. Run # vi / home/Fedora CVS server root/Fedora CVS server .run
The script reads as follows:
#! / bin/bash / usr/bin/Fedora CVS server-f "--allow-root=/home/Fedora CVS server root/pro1"-- allow-root=/home/Fedora CVS server root/pro2 "--allow-root=/home/Fedora CVS server root/pro3"-- allow-root=/home/Fedora CVS server root/pro4 "--allow-root=/home/Fedora CVS server root/pro5"-- allow-root=/home/Fedora CVS server root/pro6 "pserver
3) change the permissions of Fedora CVS server .run: # chmod + x / home/Fedora CVS server root/Fedora CVS server .run
4) restart the service: # service xinetd restart is ready, and now several independent warehouses have been set up.
The above is all the contents of the article "how to install and configure the Fedora CVS server and create user groups". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.