SVN使用LDAP认证

article/2025/9/13 9:09:38

前言

SVN架构

用户访问SVN服务器分为两个部分:认证与授权。

SVN内置了有认证与授权机制,其认证是通过SVN仓库内的passwd文件提供,但它是明文、静态的,不方便且安全性低。

SVN还支持外部的认证,比如SASL,HTTP等。本文介绍使用SVN+SASL+LDAP认证。

原理介绍

SASL全称是Cyrus Simple Authentication and Security Layer,它支持包括LDAP在内的多种认证方式,如Kerberos(GSSAPI), NTLM, One-Time-Passwords(OTP), DIGEST-MD5, Secure-Remote-Password(SRP)等。

步骤

SVN服务器

SVN服务端,是一台CentOS 7.9。

安装包,

[root@computing-host-001 ~]# yum install -y subversion cyrus-sasl cyrus-sasl-lib cyrus-sasl-plain

配置cyrus-sasl,

[root@computing-host-001 ~]# cat > /etc/saslauthd.conf << EOF
ldap_servers: ldaps://ipa-server-001.icinfra.cn
ldap_mech: PLAIN
ldap_search_base: cn=users,cn=accounts,dc=icinfra,dc=cn
#ldap_filter: (cn=%u)
ldap_filter: (uid=%u)
ldap_bind_dn: uid=wanlinwang,cn=users,cn=accounts,dc=icinfra,dc=cn
ldap_password: 123456
EOF
[root@computing-host-001 ~]# cat /etc/sysconfig/saslauthd
# Directory in which to place saslauthd's listening socket, pid file, and so
# on.  This directory must already exist.
SOCKETDIR=/run/saslauthd# Mechanism to use when checking passwords.  Run "saslauthd -v" to get a list
# of which mechanism your installation was compiled with the ablity to use.
MECH=ldap# Additional flags to pass to saslauthd on the command line.  See saslauthd(8)
# for the list of accepted flags.
FLAGS=
[root@computing-host-001 ~]# 

启动cyrus-sasl,

[root@computing-host-001 ~]# systemctl enable saslauthd --now

验证,其中123456是正确的LDAP密码,而1234567是错误的,

[root@computing-host-001 ~]# testsaslauthd -u wanlinwang -p 123456
0: OK "Success."
[root@computing-host-001 ~]# testsaslauthd -u wanlinwang -p 1234567
0: NO "authentication failed"

修改SVN的SASL配置,

[root@computing-host-001 ~]# cat /etc/sasl2/svn.conf 
pwcheck_method: saslauthd
#auxprop_plugin: ldap
mech_list: plain login cram-md5 digest-md5

svn仓库配置,

[root@computing-host-001 ~]# svnadmin create --fs-type fsfs svn_repo
[root@computing-host-001 ~]# cat svn_repo/conf/svnserve.conf| grep -Ev '^\s*#'
[general]
anon-access = none
auth-access = write
authz-db = authz
[sasl]
use-sasl = true
[root@computing-host-001 ~]# cat svn_repo/conf/authz| grep -Ev '^\s*#'
[aliases]
[groups]
[/]
wanlinwang = rw
[root@computing-host-001 ~]# svnserve -d -r ~/svn_repo --listen-port 8888
[root@computing-host-001 ~]# ps -ef| grep svns
root      2815     1  0 10:40 ?        00:00:00 svnserve -d -r /root/svn_repo --listen-port 8888
root      2846  2506  0 10:42 pts/2    00:00:00 grep --color=auto svns

SVN客户端

在另一台服务器,执行svn checkout并使用LDAP账号密码认证,

[wanlinwang@computing-host-002 ~]$ mkdir  svn_working_copy/
[wanlinwang@computing-host-002 ~]$ cd svn_working_copy/
[wanlinwang@computing-host-002 ~/svn_working_copy]$ svn co svn://computing-host-001:8888/
Authentication realm: <svn://computing-host-001:8888> 242544f5-a785-46dc-9773-b79fe3fdd8a1
Password for 'wanlinwang': -----------------------------------------------------------------------
ATTENTION!  Your password for authentication realm:<svn://computing-host-001:8888> 242544f5-a785-46dc-9773-b79fe3fdd8a1can only be stored to disk unencrypted!  You are advised to configure
your system so that Subversion can store passwords encrypted, if
possible.  See the documentation for details.You can avoid future appearances of this warning by setting the value
of the 'store-plaintext-passwords' option to either 'yes' or 'no' in
'/home/wanlinwang/.subversion/servers'.
-----------------------------------------------------------------------
Store password unencrypted (yes/no)? yes
Checked out revision 0.
[wanlinwang@computing-host-002 ~/svn_working_copy]$ echo "First file" > test.txt
[wanlinwang@computing-host-002 ~/svn_working_copy]$ svn add test.txt 
A         test.txt
[wanlinwang@computing-host-002 ~/svn_working_copy]$ svn ci -m 'Added first file.'
Adding         test.txt
Transmitting file data .
Committed revision 1.

参考资料:

Version Control with Subversionhttps://svnbook.red-bean.com/en/1.7/svn-book.html

https://svn.apache.org/repos/asf/subversion/trunk/notes/sasl.txthttps://svn.apache.org/repos/asf/subversion/trunk/notes/sasl.txt

Svn authentication and authorization using LDAP protocol | Develop Paperhttps://developpaper.com/svn-authentication-and-authorization-using-ldap-protocol/


http://chatgpt.dhexx.cn/article/9m0FJgxx.shtml

相关文章

ldap 认证 java_Java实现LDAP认证(上)

Baidu脑残&#xff0c;把原来的空间改得不伦不类。所以把一些技术的东西挪到这里。 我找到两种方法&#xff0c;大同小异&#xff0c;第一种是通过Spring&#xff0c;适合已经采用Spring的项目。 一般来说用户名和密码都是保存在数据库中。现在有这个需求&#xff0c;用户名和密…

Harbor 整合ldap认证

前提&#xff1a; ldap服务器已经安装&#xff1a;OpenLDAP安装部署 harbor服务器已经安装&#xff1a;Harbro v1.8.0部署 一、ldap组织结构 1、登录信息 2、查看用户信息 二、harbor配置 1、使用默认密码登录&#xff0c;admin/Harbor12345 2、认证模式 3、测试ldap服务器…

ldap认证 java_Java实现LDAP认证(上) | 学步园

Baidu脑残&#xff0c;把原来的空间改得不伦不类。所以把一些技术的东西挪到这里。 我找到两种方法&#xff0c;大同小异&#xff0c;第一种是通过Spring&#xff0c;适合已经采用Spring的项目。 一般来说用户名和密码都是保存在数据库中。现在有这个需求&#xff0c;用户名和密…

Zabbix 整合ldap认证

前提&#xff1a; zabbix部署完成&#xff1a;CentOS7.3 64位&#xff0c;搭建Zabbix3.4 ldap部署完成&#xff1a;OpenLDAP安装部署 一、LDAP服务端 1、ldap登录信息 2、查看ldap组织架构 3、添加zabbix默认用户Admin 二、Zabbix网页端 1、使用zabbix默认管理员用户登录 …

linux+配置ldap认证,Linux LDAP 认证配置

Linux通过LDAP方式&#xff0c;使用windows AD帐户登录linux shell&#xff0c;这个想法很cool吧。之前配置过一次&#xff0c;但过了太久忘记了&#xff0c;因此&#xff0c;今天把配 Linux通过LDAP方式&#xff0c;使用windows AD帐户登录linux shell&#xff0c;这个想法很c…

JumpServer 整合ldap认证

前提&#xff1a; ldap服务器已经安装&#xff1a;OpenLDAP安装部署 一、JumpServer安装 官网安装地址安装部署 - JumpServer 文档 1、一键部署 #系统版本 [rootlocalhost ~]# cat /etc/redhat-release CentOS Linux release 7.6.1810 (Core) #默认会安装到 /opt/jumpser…

linux samba 配置ldap认证,Samba集成Ldap认证

Samba集成Ldap认证 1.基础安装 yum -y install samba-common samba samba-client smbldap-tools openldap-clients nss-pam-ldapd 2.配置authconfig-tui 执行命令 "authconfig-tui" 验证配置 # getent passwd zhangsan:x:6460:18650:zhangsan:/home/zhangsan:/bin/…

SVN集成LDAP认证

如何将 LDAP 的认证&#xff0c;集成到 SVN 中。集成的办法&#xff0c;目前是有两种&#xff1a;一种是 SVN 直接通过 SVN 端口直接访问的&#xff0c;通过 SASL 实现 LDAP 的认证&#xff1b;另一种是 SVN 通过 Apache 进行 HTTP 访问的用户&#xff0c;通过配置 Apache &…

zabbix配置ldap认证

zabbix配置ldap认证 环境&#xff1a; centos6.6 zabbix3.0.3 域控服务器&#xff1a;windows-active server 2008 需求&#xff1a; 公司越来越大&#xff0c;人越来越多&#xff0c;配置人员的账号密码很麻烦。 为了集中管理&#xff0c;整合公司的用户密码&#xff0c…

LDAP认证-ldap介绍

OpenLDAP简介 LDAP 全称轻量级目录访问协议&#xff0c;是一个运行在 TCP/IP 上的目录访问协议。LDAP实现 提供被称为目录服务的信息服务&#xff0c;可以看做是一张特殊的数据库系统。可以有效的 解决众多网络服务的用户账户问题&#xff0c;规定了统一的身份信息数据库、身份…

LDAP认证

注&#xff1a;本文由网络公开资料整理而来&#xff0c;如有错误&#xff0c;欢迎指正。 LDAP&#xff08;Lightweight Directory Access Protocol&#xff09;是目录服务&#xff08;DAP&#xff09;在TCP/IP上的实现&#xff0c;它是对X.500目录协议的移植&#xff0c;但是简…

BlazeDS简单介绍

BlazeDS 是一个基于服务器的 Java 远程控制 (remoting) 和 Web 消息传递 (messaging) 技术&#xff0c;以LGPL&#xff08;Lesser GNU Public License&#xff09;公共许可证书发布。它能够使得后端的 Java 应用程序和运行在浏览器上的 Adobe Flex 应用程序相互通信。在Java应用…

关于BLAS的简单介绍

BLAS(Basic Linear Algebra Subprograms基础线性代数程序集)是进行向量和矩阵等基本线性代数操作的事实上的数值库。这些程序最早在1979年发布&#xff0c;是LAPACK(Linear Algebra PACKage)的一部分&#xff0c;便于建立功能更强的数值程序包。BLAS库在高性能计算中被广泛应用…

Blazor 基础入门

Blazor 基础知识 Intro Blazor 是微软在 .NET 里推出的一个 WEB 客户端 UI 交互的框架&#xff0c; 使用 Blazor 你可以代替 JavaScript 来实现自己的页面交互逻辑&#xff0c;可以很大程度上进行 C# 代码的复用&#xff0c;Blazor 对于 .NET 开发人员来说是一个不错的选择。 托…

Blazeds学习

BlazeDS是一个基于服务器的Java远程调用&#xff08;remoting&#xff09;和Web消息传递&#xff08;messaging&#xff09;技术&#xff0c;使得后台的Java应用程序和运行在浏览器上的Flex应用程序能够相互通信 一个BlazeDS应用包括两个部分&#xff1a;一个客户端应用程序和…

Blazeds初步

客户端应用 Blazeds包括客户端和服务端应用。客户端应用是典型的Adobe flex或者AIR应用。Flex和AIR应用使用flex组件和blazeds服务通信&#xff0c;包括Remote Object、HTTPService、WebService、Produce和Consumer。其中的HTTPService、WebService、Produce和Consumer是Flex S…

BlazeDS配置实例

.什么是BlazeDS BlazeDS is the server-based Java remoting and web messaging technology that enables developers to easily connect to back-end distributed data and push data in real-time to Adobe Flex and Adobe AIR™ applications for more responsive rich Inte…

Bazel

bazel&#xff1a;是一个可以快速构建和测试任意规模软件的编译工具&#xff0c;能够用来编译大部分语言。Bazel使用分布式缓存和增量构建方法&#xff0c;使得编译更加快速。 Bazel 主要文件 使用 Bazel 管理的项目一般包含以下几种 Bazel 相关的文件&#xff1a;WORKSPACE&a…

BlazeDS

BlazeDS 为使用Flex 或者AIR 的客户端程序提供了高度可扩展的远程访问和消息服务。 blazeds :是一门技术&#xff0c;是一门面向AS的前后台通讯框架 在服务器端&#xff1a;提供3种服务&#xff0c;远程调用&#xff08;remoting-config.xml中配置&#xff09;&#xff0c;访问…

Blazeds(一)

Blazeds体系结构 一个Blazeds应用包含了一个运行在浏览器或者Adobe AIR的客户端应用并且和J2EE应用服务端通信。客户端可以是Flex也可以是结合Flex、HTML/JavaScript的应用程序。 整个体系主要包括通道、端点、消息、服务、目的地、适配器等&#xff0c;把这些搞懂也就…