Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install subversion in CentOS system and access it using svn+ssh

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

CentOS system how to install subversion and use svn+ssh access, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can get something.

When using CentOS system, we need to use subversion, so how to install subversion in CentOS system and use svn+ssh to access it? let's explain the steps in detail.

1. CentOS system server installation

(1) install ssh server and subversion server on CentOS system

Yum update

Yum install openssh-server

Yum install subversion

Yum update

Yum install openssh-server

Yum install subversion

(2) create users who log in to svn in CentOS system

Useradd fify; add fify user

Groupadd svn; add svn user group

Usermod-a-G svn fify; add fify users to the svn user group

Useradd fify; add fify user

Groupadd svn; add svn user group

Usermod-a-G svn fify; add fify users to the svn user group

In addition, if the fify user does not exist, you can replace the above three sentences with the following statement:

Useradd-g svn fify

Useradd-g svn fify

(3) establish user storage in CentOS system

Mkdir / home/fify/svn

Mkdir / home/fify/trunk

Svnadmin create / home/fify/svn/trunk

Mkdir / home/fify/svn

Mkdir / home/fify/trunk

Svnadmin create / home/fify/svn/trunk

(4) Grant permissions to the svn user group

View plaincopy to clipboardprint?

Chown-R root:svn / home/fify/svn/trunk

Chmod-R g+rws / home/fify/svn/trunk / * gives read and write permissions to the svn group, and you can change the permissions as needed * /

Chmod-R o-rwx / home/fify/svn/trunk / * removes the read, write and execute permissions of other unrelated people. By default, other people may have read permissions * /

Chown-R root:svn / home/fify/svn/trunk

Chmod-R g+rws / home/fify/svn/trunk / * gives read and write permissions to the svn group, and you can change the permissions as needed * /

Chmod-R o-rwx / home/fify/svn/trunk / * removes the read, write and execute permissions of other unrelated people. By default, other people may have read permissions * /

(5) generate keys for members

Switch users:

View plaincopy to clipboardprint?

Su fify

Su fify

Generate key pairs:

View plaincopy to clipboardprint?

Ssh-keygen-b 1024-t rsa-N passwd-f fifykey

Ssh-keygen-b 1024-t rsa-N passwd-f fifykey

Where passphrase is the key keyword (equivalent to password), which is customized by the user; fifykey is the key file name, and two files will be generated after generation, fifykey and fifykey.pub, where the former is the key and the latter is the public key; rsa specifies that rsa is used for encryption, and if it becomes dsa, dsa encryption is used

(6) the CentOS system creates the / home/fify/.ssh directory, and copies and renames the public key to authorized_keys to this directory:

Cp fifykey.pub / home/fify/.ssh/authorized_keys

Cp fifykey.pub / home/fify/.ssh/authorized_keys

Note: the file name must be authorized_keys

(7) CentOS system changes resource access permissions

Modify the / home/fify/svn/trunk/conf/svnserve.conf file to add the following lines to the general:

View plaincopy to clipboardprint?

Anon-access = none / / unauthenticated users do not have any access rights

Auth-access = write / / authenticated user has write permission

Authz-db = authz / / the authentication file is the authz file in the conf directory

Anon-access = none / / unauthenticated users do not have any access rights

Auth-access = write / / authenticated user has write permission

Authz-db = authz / / the authentication file is the authz file in the conf directory

Modify the / home/fify/svn/trunk/conf/authz file (or create it if you don't have it) and add:

View plaincopy to clipboardprint?

[/] / access is the root directory of this resource (and the following directory)

Fify = rw / / fify users have access rights of "read + write"

[/] / access is the root directory of this resource (and the following directory)

Fify = rw / / fify users have access rights of "read + write"

The following methods can also be used for authentication:

View plaincopy to clipboardprint?

[groups]

Svn = fify,sim / / define user groups svn contains two users: fify and sim

[/]

@ svn = rw / / members of the svn user group have access rights of read + write

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report