搜索

4.2. 以非 root 用户身份安装新实例

download PDF

要在没有 root 权限的情况下安装目录服务器,您可以使用交互式安装程序。安装后,Directory 服务器会在自定义位置创建一个实例,用户可以像常一样运行 dscreatedsctldsconf 实用程序。

前提条件

  • 为非 root 安装准备了环境。
  • 您有 sudo 权限来使用 firewall-cmd 工具,如果要从外部提供目录服务器实例。

流程

  1. 使用互动安装程序创建实例

    1. 启动交互式安装程序:

      $ dscreate interactive
    2. 回答交互式安装程序的问题。

      要使用安装程序中大部分问题后面的方括号中显示的默认值,请按 Enter 键,而无需输入值。

      注意

      在安装过程中,您必须选择实例端口和安全端口号 大于 1024 (例如 1389 和 1636)。否则,用户没有绑定到特权端口(1-1023)的权限。

      Install Directory Server (interactive mode)
      ===========================================
      Non privileged user cannot use semanage, will not relabel ports or files.
      
      Selinux support will be disabled, continue? [yes]: yes
      
      Enter system's hostname [server.example.com]:
      
      Enter the instance name [server]: instance_name
      
      Enter port number [389]: 1389
      
      Create self-signed certificate database [yes]:
      
      Enter secure port number [636]: 1636
      
      Enter Directory Manager DN [cn=Directory Manager]:
      
      Enter the Directory Manager password: password
      Confirm the Directory Manager Password: password
      
      Enter the database suffix (or enter "none" to skip) [dc=server,dc=example,dc=com]: dc=example,dc=com
      
      Create sample entries in the suffix [no]:
      
      Create just the top suffix entry [no]: yes
      
      Do you want to start the instance after the installation? [yes]:
      
      Are you ready to install? [no]: yes
      注意

      您可以设置由 pwdhash 生成的 {algorithm}hash 字符串来设置密码,而不是使用明文密码。

  2. 可选:如果要使目录服务器实例从外部可用:

    1. 在防火墙中打开端口:

      # sudo firewall-cmd --permanent --add-port={1389/tcp,1636/tcp}
    2. 重新载入防火墙配置:

      # sudo firewall-cmd --reload

验证

  • 运行 ldapsearch 命令来测试用户可以连接到实例:

    $ ldapsearch -D "cn=Directory Manager" -W -H ldap://server.example.com:1389 -b "dc=example,dc=com" -s sub -x "(objectclass=*)"
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.