AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-182075

mveroone's questions

Martin Hope
mveroone
Asked: 2021-08-21 01:06:58 +0800 CST

nss-pam-ldapd 密码验证仅在使用 `su` 时在 CentOS 7 上不起作用

  • 0

语境

我这里有 2 台不同的机器,它们的主要区别是一个运行 CentOS6,另一个运行 CentOS7。两者都运行最新的可用分发版本的 lib:COS7 为 0.8.13,CentOS6 为 0.7.5 两者都运行“正常”配置的 nss-pam-ldapd:

/etc/nslcd.conf

uid nslcd
gid ldap

uri ldap://ldap.example.org/
base dc=example,dc=org

ssl no
tls_cacertdir /etc/openldap/cacerts
idle_timelimit 240

base   group  ou=groups,dc=example,dc=org

binddn cn=Readonly,dc=example,dc=org
bindpw **************

服务器权限:

olcAccess: {0}to attrs=userPassword,shadowLastChange by dn="cn=Manager,dc=cube-net,dc=org" write by dn="cn=Readonly,dc=example,dc=org" none by anonymous auth by self write by * none
olcAccess: {1}to dn.base="cn=Readonly,dc=example,dc=org" by dn="cn=Manager,dc=example,dc=org" write by * none
olcAccess: {2}to dn.base="" by * read
olcAccess: {3}to * by dn="cn=Manager,dc=example,dc=org" write by dn="cn=Readonly,dc=example,dc=org" read by self write by * read

问题

我可以很好地查找用户,但我无法以su在 CentOS 7 上使用的用户身份登录。我得到:

mveroone@vm:~$ passwd
Changing password for user mveroone.
(current) LDAP Password: 
New password: 
Retype new password: 
passwd: all authentication tokens updated successfully.
mveroone@vm:~$ su - mveroone
Password: 
su: Permission denied
mveroone@vm:~$ ssh localhost
Authorized uses only. All activity may be \ monitored and reported.
mveroone@localhost's password: 
Last login: Fri Aug 20 16:10:24 2021

Authorized uses only. All activity may be \ monitored and reported.
mveroone@vm:~$ 

所以是的,我可以使用 SSH 登录,更改我的密码,但不能使用 su。

我试过的

使用简单的绑定方法在两台服务器上执行 aldapwhoami工作,但不是 SASL(无可用机制)

root@vm:~# ldapwhoami -D uid=user,ou=users,dc=example,dc=org -W -H ldap://ldap.example.org  
Enter LDAP Password: 
dn:uid=user,ou=users,dc=example,dc=org

nslcd -d在尝试使用密码验证时运行su仅在 COS7 中显示:

nslcd: DEBUG: accept() failed (ignored): Resource temporarily unavailable

尽管根据几个邮件列表线程,这似乎是一个可以忽略的错误。

当使用附加调试()运行 nslcd 时nslcd -dd,我可以看到它首先尝试与用户绑定,这成功了,然后它搜索'(objectClass=*)',过滤属性:dn和 base = 本身有效:

ldap_free_request (origid 1, msgid 1)
ldap_parse_result
ldap_msgfree
ldap_search_ext
put_filter: "(objectClass=*)"
put_filter: simple
put_simple_filter: "objectClass=*"
ldap_build_search_req ATTRS: dn
ldap_send_initial_request
ldap_send_server_request
ldap_result ld 0x7f7a9800cf60 msgid 2
wait4msg ld 0x7f7a9800cf60 msgid 2 (timeout 10000000 usec)
wait4msg continue ld 0x7f7a9800cf60 msgid 2 all 0
** ld 0x7f7a9800cf60 Connections:
 * host: ldap.example.org  port: 389  (default)
  refcnt: 2  status: Connected
  last used: Fri Aug 20 11:42:05 2021


** ld 0x7f7a9800cf60 Outstanding Requests:
 * msgid 2,  origid 2, status InProgress
   outstanding referrals 0, parent count 0
  ld 0x7f7a9800cf60 request count 1 (abandoned 0)
** ld 0x7f7a9800cf60 Response Queue:
   Empty
  ld 0x7f7a9800cf60 response count 0
ldap_chkResponseList ld 0x7f7a9800cf60 msgid 2 all 0
ldap_chkResponseList returns ld 0x7f7a9800cf60 NULL
ldap_int_select
read1msg: ld 0x7f7a9800cf60 msgid 2 all 0
read1msg: ld 0x7f7a9800cf60 msgid 2 message type search-entry
ldap_get_dn
nslcd: [0e0f76] <authc="user"> DEBUG: ldap_result(): uid=user,ou=users,dc=example,dc=org
ldap_msgfree
ldap_abandon 2
ldap_abandon_ext 2
do_abandon origid 2, msgid 2
ldap_msgdelete ld=0x7f7a9800cf60 msgid=2
ldap_free_request (origid 2, msgid 2)
ldap_free_connection 0 1
ldap_free_connection: refcnt 1
ldap_msgfree
nslcd: [0e0f76] <authc="user"> DEBUG: ldap_unbind()
ldap_unbind

所以路径是:

  • 绑定(确定)
  • 搜索自己的DN(ok)
  • 放弃
  • 解绑

然后告诉我它无法验证用户。(“权限被拒绝”,所以它与“身份验证失败”不同)我执行了一个数据包捕获,它显示了同样的事情。

我已经尝试通过 nslcd 的 0.8.x 版本的变更日志来查看是否发生了一些变化,但是有很多变化,没有足够的细节。

pam-ldap nss
  • 1 个回答
  • 218 Views
Martin Hope
mveroone
Asked: 2018-10-04 06:55:06 +0800 CST

NAT/LB 后面的 Apache Kafka 配置

  • 3

为了使我们的 Kafka 集群既可以从 Internet 也可以从我们的专用网络使用,我们认为可以这样配置 Kafka:

Private VIP:9000 => All brokers:9092 (topology query only)
Private VIP:9001 => Broker #1:9092
Private VIP:9002 => Broker #2:9092
...
Public VIP:9000 => All brokers:9092 (topology query only)
Public VIP:9001 => Broker #1:9092
Public VIP:9002 => Broker #2:9092
...

我们以这种方式配置了负载均衡器,然后是我们的代理:

listeners=PLAINTEXT://<server_priv_ip>:9092
advertised.listeners=INTERNAL://<private_VIP>:9001,EXTERNAL://<public_vip>:9001
listener.security.protocol.map=INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT
inter.broker.listener.name=INTERNAL

现在,正如您所料,Kafka 代理不会启动:

ERROR Exiting Kafka due to fatal exception (kafka.Kafka$)
java.lang.IllegalArgumentException: requirement failed: Each listener must have a different port, listeners: INTERNAL://<private_VIP>:9001,EXTERNAL://<public_vip>:9001

从我的管理员的角度来看,我的方法是完全合乎逻辑的,尽管我预计生产者/消费者会从他们联系经纪人的任何地方获得两个地址的问题。在 2 个不同的地址上使用相同的端口似乎是合乎逻辑的,并且可以提高清晰度……

第一个问题:为什么这是错误的?
第二个问题:如果不是这样,我怎样才能实现我的目标?(大多数选项都在桌面上)

load-balancing
  • 2 个回答
  • 4493 Views
Martin Hope
mveroone
Asked: 2017-05-16 23:21:50 +0800 CST

Zabbix 前端忽略数据库配置

  • 0

我有一个成功的 zabbix 3.4 服务器在一个带有嵌入式数据库的 LXC 容器(CentOS7 基础)中运行了一个月,我决定将我服务器上的所有容器数据库合并为一个。所以我转储了 zabbix 数据库,将其移至容器,使其 3306 端口可用。从 Zabbix 容器中,我可以使用命令行成功登录 mysql。更新后服务器后端似乎可以/etc/my.cnf

问题是前端仍然尝试通过本地套接字联系 mysql :

Error connecting to database: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

我试图重命名/usr/share/zabbix/conf/zabbix.conf.php.example并将/usr/share/zabbix/conf/zabbix.conf.php数据库配置放入其中,但它没有改变任何东西。我试图通过 grep/usr/share/zabbix搜索我的数据库凭据的整个目录,但没有成功。

前端数据库配置存储在哪里?还是我做错了什么?

配置:

# grep ^DB /etc/zabbix/zabbix_server.conf 
DBHost=mysql.host #local host name
DBName=zabbix
DBUser=zabbix
DBPassword=*******
DBPort=3306

# cat zabbix.conf.php 
<?php
// Zabbix GUI configuration file.
global $DB;
$DB['TYPE']                             = 'MYSQL';
$DB['SERVER']                   = 'mysql.host';
$DB['PORT']                             = '3306';
$DB['DATABASE']                 = 'zabbix';
$DB['USER']                             = 'zabbix';
$DB['PASSWORD']                 = '******';
...
mysql
  • 1 个回答
  • 5017 Views
Martin Hope
mveroone
Asked: 2016-10-12 07:12:11 +0800 CST

systemd 在停止网络之前不会卸载 NFS 共享

  • 4

语境 :

  • 截至 2016 年 10 月的 RHEL 7.2
  • 物理系统
  • 网络管理器已禁用
  • 通过将 2x10G NIC(eth0 和 eth1)组合为 lacp0 配置的网络
  • (不相关)在 VLAN 子接口 lacp0.XXX 和 lacp0.YYY 上配置 IP 地址
  • (也无关紧要)这些系统注定是Oracle 12c节点

网络连接 100% OK,基准测试确认 LACP 功能齐全,接近 20 GBps 的理论最大值。

问题 :

systemd 不会检测到网络堆栈在关机期间停止,并一直等到为时已晚才卸载 NFS 共享,因此无法卸载它们,这导致它无限期地挂起以等待 NFS 服务器响应。

症状) :

运行“systemctl stop network.service”后,network.target 和 network-online.target 仍然被认为是活动的。

到目前为止我所做的:

通过文件添加的 NFS 挂载/etc/fstab被转换为*.mountsystemd 单元。这些单元自动取决于remote-fs.target哪个取决于 `network-online.target。

从文档来看,network*.target 似乎依赖于网络管理工具来检测网络是否正常等。这可以是NetworkManager,systemd-nerworkd或其他任何东西(但什么?)。我认为我的问题可能在这里,因为我们的 jumpstart 模板似乎依赖于旧的 init 脚本来管理接口。而且我怀疑 systemd 是否可以与它交互以获知网络正在启动或关闭(尽管被用来停止网络堆栈systemctl stop network)

我的第二个假设是即使通过 ifcfg-* 文件使用 libteam/teamd 的网络组合不在 systemd network.target 范围内。teamd systemd 单元(包括 [email protected])和网络单元之间似乎没有依赖关系。这可以解释为什么显示此问题的唯一系统是那些启用了 LACP 的系统,而我们之前在使用典型绑定时没有遇到此问题。

所以我的问题是:在我的网络堆栈被关闭之前,通常在重新启动系统时,我必须确保我的 NFS 共享被卸载?

PS:如果上述解决方案不是来自创建 NFS 挂载的方式会更好,这样必须向该服务器添加共享的人不必被告知要采取的特殊步骤。考虑到我们的生产过程,这似乎几乎是不可能的。

nfs redhat systemd linux-networking lacp
  • 1 个回答
  • 2776 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve