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-949172

Karol's questions

Martin Hope
Karol
Asked: 2023-10-04 05:19:50 +0800 CST

在 Debian 12 上无法使用 nslcd 和 openldap 为 root 提供 passwd

  • 5

用于实验室 (VM) 的全新 Debian 12。我安装了:slapd、phpldapadmin、nslcd、nscd 和依赖项。我有两个本地帐户:root 和 user1。另外,我在本地 LDAP 服务器上只有 user1 POSIX 帐户。我可以通过 passwd 更改 user1 的密码。密码在 LDAP 服务器和影子文件中均发生更改。我可以通过 ssh 以 root 和 user1 身份登录。

我无法通过 passwd 更改 root 的密码,因为在我调用该程序后:

passwd: Authentication token manipulation error 
passwd: password unchanged

没有提示输入密码(当前密码或新密码)。

如果LDAP服务器上没有root帐号,如何修改本地root密码?
这是 passwd 的正确结果还是某些配置错误?

这是我的配置:

nslcd.conf:

uid nslcd
gid nslcd
uri ldap://127.0.0.1/
base dc=debian,dc=valhalla,dc=**,dc=**
tls_cacertfile /etc/ssl/certs/ca-certificates.crt

nscd.conf:

debug-level             0
paranoia                no
enable-cache            passwd          yes
positive-time-to-live   passwd          600
negative-time-to-live   passwd          20
suggested-size          passwd          211
check-files             passwd          yes
persistent              passwd          yes
shared                  passwd          yes
max-db-size             passwd          33554432
auto-propagate          passwd          yes
enable-cache            group           yes
positive-time-to-live   group           3600
negative-time-to-live   group           60
suggested-size          group           211
check-files             group           yes
persistent              group           yes
shared                  group           yes
max-db-size             group           33554432
auto-propagate          group           yes
enable-cache            hosts           yes
positive-time-to-live   hosts           3600
negative-time-to-live   hosts           20
suggested-size          hosts           211
check-files             hosts           yes
persistent              hosts           yes
shared                  hosts           yes
max-db-size             hosts           33554432
enable-cache            services        yes
positive-time-to-live   services        28800
negative-time-to-live   services        20
suggested-size          services        211
check-files             services        yes
persistent              services        yes
shared                  services        yes
max-db-size             services        33554432
enable-cache            netgroup        yes
positive-time-to-live   netgroup        28800
negative-time-to-live   netgroup        20
suggested-size          netgroup        211
check-files             netgroup        yes
persistent              netgroup        yes
shared                  netgroup        yes
max-db-size             netgroup        33554432

nsswitch.conf:

passwd:         files ldap
group:          files ldap
shadow:         files ldap
gshadow:        files
hosts:          files dns
networks:       files
protocols:      db files
services:       db files
ethers:         db files
rpc:            db files
netgroup:       nis

普通账户:

account [success=1 new_authtok_reqd=done default=ignore]        pam_unix.so
account requisite                       pam_deny.so
account required                        pam_permit.so
account [success=ok new_authtok_reqd=done ignore=ignore user_unknown=ignore authinfo_unavail=ignore default=bad]        pam_ldap.so minimum_uid=1000

通用授权:

auth    [success=2 default=ignore]      pam_unix.so nullok
auth    [success=1 default=ignore]      pam_ldap.so minimum_uid=1000 use_first_pass
auth    requisite                       pam_deny.so
auth    required                        pam_permit.so

通用密码:

password        required        pam_unix.so obscure yescrypt
password        sufficient      pam_ldap.so minimum_uid=1000 try_first_pass
password        requisite                       pam_deny.so
password        required                        pam_permit.so

共同会议:

session [default=1]                     pam_permit.so
session requisite                       pam_deny.so
session required                        pam_permit.so
session required        pam_unix.so
session [success=ok default=ignore]     pam_ldap.so minimum_uid=1000
session optional        pam_systemd.so
linux
  • 1 个回答
  • 57 Views
Martin Hope
Karol
Asked: 2022-01-08 05:14:24 +0800 CST

SSH 认证:(公钥异或密码)+ google 验证码

  • 1

我正在使用 Debian 靶心。我正在尝试设置 SSH 两种类型的登录:

  1. 来自 Google Authenticator 的密码 + 代码(如果用户设置它,“nullok”选项),
  2. 来自 Google Authenticator 的公钥 + 代码(如果用户设置了它,“nullok”选项)。

类型 #1 对我有用。在类型 #2 中,我有来自 GA 的公钥 + 密码(不是公钥密码)+ 代码。我将此行添加到 /etc/ssh/sshd_config

AuthenticationMethods publickey,keyboard-interactive keyboard-interactive

如果提供了密钥,我希望用户不会被提示输入密码。准确地说,如果提供了公钥,如何绕过 pam_unix.so 需求?

有什么办法可以在一台机器上完成我想要的吗?提前致谢。

debian ssh pam google-authenticator two-factor-authentication
  • 1 个回答
  • 104 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