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
    • 最新
    • 标签
主页 / server / 问题 / 746194
Accepted
2rs2ts
2rs2ts
Asked: 2016-01-01 10:55:09 +0800 CST2016-01-01 10:55:09 +0800 CST 2016-01-01 10:55:09 +0800 CST

是否可以通过 sssd 在 TLS 上使用 Kerberos?

  • 772

背景

我正在尝试以sssd我在 AWS Directory Services Simple AD 中创建的用户身份登录(通过 SSH,登录到正在运行的 Amazon Linux EC2 实例)。我正在使用 Kerberos 进行身份验证并使用 LDAP 识别用户(全部通过sssd.)。我通过多个代理服务器上的 ELB 连接到 Simple AD。

问题

当我将 ELB 配置为对 Kerberos 端口使用 TLS 时,sssd无法连接到 Kerberos 服务器并且登录失败。如果没有 TLS,它就可以正常工作,一旦我在没有 TLS 的情况下登录,凭据就会被缓存,当我重新打开 TLS 时,登录会继续工作。

RFC 6251解释了如何通过 TLS 传输 Kerberos V5,所以假设这应该是可能的,对吧?我不确定我是否没有正确执行此操作,或者是否sssd不支持 Kerberos over TLS。谷歌搜索不会产生任何成果,并且手册页中没有任何看似相关的内容。

请注意,我的 LDAPS 通过 ELB 完美运行,所以我至少知道我并没有完全偏离轨道。

TL;DR 如何回答我的问题

要么告诉我:

  • 通过 TLS 设置 Kerberos 时我做错了什么,或者
  • sssd不支持基于 TLS 的 Kerberos

错误信息

这是来自 的输出sssd。请注意,我编辑了 IP 地址。

(Thu Dec 31 18:36:43 2015) [[sssd[krb5_child[2780]]]] [sss_child_krb5_trace_cb] (0x4000): [2780] 1451587003.307171: Sending request (218 bytes) to MYTEAM.MYCOMPANY.INTERNAL

(Thu Dec 31 18:36:43 2015) [[sssd[krb5_child[2780]]]] [sss_child_krb5_trace_cb] (0x4000): [2780] 1451587003.307390: Initiating TCP connection to stream 1.2.3.4:88

(Thu Dec 31 18:36:43 2015) [[sssd[krb5_child[2780]]]] [sss_child_krb5_trace_cb] (0x4000): [2780] 1451587003.309053: Sending TCP request to stream 1.2.3.4:88

(Thu Dec 31 18:36:43 2015) [[sssd[krb5_child[2780]]]] [sss_child_krb5_trace_cb] (0x4000): [2780] 1451587003.310487: TCP error receiving from stream 1.2.3.4:88: 104/Connection reset by peer

(Thu Dec 31 18:36:43 2015) [[sssd[krb5_child[2780]]]] [sss_child_krb5_trace_cb] (0x4000): [2780] 1451587003.310609: Terminating TCP connection to stream 1.2.3.4:88

(Thu Dec 31 18:36:43 2015) [[sssd[krb5_child[2780]]]] [sss_child_krb5_trace_cb] (0x4000): [2780] 1451587003.310729: Sending initial UDP request to dgram 1.2.3.4:88

# Lots of other output...

(Thu Dec 31 18:36:58 2015) [sssd[be[myteam]]] [krb5_child_timeout] (0x0040): Timeout for child [2780] reached. In case KDC is distant or network is slow you may consider increasing value of krb5_auth_timeout.
(Thu Dec 31 18:36:58 2015) [sssd[be[myteam]]] [krb5_auth_done] (0x0020): child timed out!

建筑学

以下是我围绕 Simple AD 的架构:

架构图

此设置使我能够使用 LDAPS,即使 AWS 的 Simple AD 不支持它。我认为它也可以让我在 TLS 上使用 Kerberos。

ELB 的 route53 记录是directory.myteam.mycompany.com,但我用于 Simple AD 的域是myteam.mycompany.internal。

ELB 配置

我使用 terraform 来创建架构。这里只是 ELB 资源的定义,其余的无关紧要:

resource "aws_elb" "proxy" {
  name = "directory-proxy-pub"
  subnets  = ["${split(",", module.vpc.public_subnet_ids_dsv)}}"]
  cross_zone_load_balancing = true
  security_groups = [ "${aws_security_group.elb-proxy.id}" ]
  listener {
    lb_port = 636
    lb_protocol = "ssl"
    instance_port = 389
    instance_protocol = "tcp"
    ssl_certificate_id = "${var.my_cert}"
  }
  listener {
    lb_port = 88
    lb_protocol = "ssl"
    instance_port = 88
    instance_protocol = "tcp"
    ssl_certificate_id = "${var.my_cert}"
  }
  health_check {
    interval = 15
    timeout = 5
    unhealthy_threshold = 2
    healthy_threshold = 3
    target = "TCP:389"
  }
  tags {
    Name = "directory-proxy"
  }
}

请注意,我使用的证书来自受信任的 CA,它是为*.myteam.mycompany.com.

运行 sssd 的机器上的配置

/etc/sssd/sssd.conf:

[sssd]
config_file_version = 2
reconnection_retries = 3
sbus_timeout = 30
services = nss, pam
domains = myteam

[nss]
default_shell = /bin/bash
fallback_homedir = /home/%u
ldap_user_home_directory = unixHomeDirectory

[pam]
reconnection_retries = 3
offline_credentials_expiration = 2
offline_failed_login_attempts = 3
offline_failed_login_delay = 5

[domain/myteam]
enumerate = true
cache_credentials = TRUE

id_provider = ldap

ldap_uri = ldaps://directory.myteam.mycompany.com
ldap_tls_cacert = /etc/pki/tls/certs/ca-bundle.crt
ldap_default_bind_dn = CN=test-user,CN=users,DC=myteam,DC=mycompany,DC=internal
ldap_default_authtok = REDACTED_PASSWORD
ldap_id_use_start_tls = true
ldap_schema = AD
ldap_force_upper_case_realm = true
ldap_id_mapping = true
ldap_search_base = CN=users,DC=myteam,DC=mycompany,DC=internal

ldap_user_uuid = none
ldap_group_uuid = none

chpass_provider = krb5
auth_provider = krb5
krb5_server = directory.myteam.mycompany.com
krb5_realm = MYTEAM.MYCOMPANY.INTERNAL
krb5_changepw_principal = kadmin/changepw
krb5_ccachedir = /tmp
krb5_ccname_template = FILE:%d/krb5cc_%U_XXXXXX
krb5_auth_timeout = 15
krb5_canonicalize = True

/etc/sysconfig/authconfig:

IPADOMAINJOINED=no
USEMKHOMEDIR=yes
USEPAMACCESS=no
CACHECREDENTIALS=yes
USESSSDAUTH=yes
USESHADOW=yes
USEWINBIND=no
PASSWDALGORITHM=sha512
FORCELEGACY=yes
USEFPRINTD=no
FORCESMARTCARD=no
USEDB=no
USELDAPAUTH=no
USEPASSWDQC=no
IPAV2NONTP=no
WINBINDKRB5=no
USELOCAUTHORIZE=yes
USEECRYPTFS=no
USECRACKLIB=yes
USEIPAV2=no
USEWINBINDAUTH=no
USESMARTCARD=no
USELDAP=yes
USENIS=no
USEKERBEROS=no
USESYSNETAUTH=no
USESSSD=yes
USEPWQUALITY=yes
USEHESIOD=no

除了这两个文件之外,我还确保sshd_config在 pam 模块中启用密码身份验证并启用 sssd sudo authconfig --updateall --enablesssd --enablesssdauth。

/etc/pam.d/system-auth:

auth        required      pam_env.so
auth        sufficient    pam_unix.so nullok try_first_pass
auth        requisite     pam_succeed_if.so uid >= 500 quiet_success
auth        sufficient    pam_sss.so use_first_pass
auth        required      pam_deny.so

account     required      pam_unix.so
account     sufficient    pam_localuser.so
account     sufficient    pam_succeed_if.so uid < 500 quiet
account     [default=bad success=ok user_unknown=ignore] pam_sss.so
account     required      pam_permit.so

password    requisite     pam_pwquality.so try_first_pass local_users_only retry=3 authtok_type=
password    sufficient    pam_unix.so sha512 shadow nullok try_first_pass use_authtok
password    sufficient    pam_sss.so use_authtok
password    required      pam_deny.so

session     optional      pam_keyinit.so revoke
session     required      pam_limits.so
-session     optional      pam_systemd.so
session     optional      pam_mkhomedir.so umask=0077
session     [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
session     required      pam_unix.so
session     optional      pam_sss.so

软件版本

  • uname -a:Linux ip-172-31-31-2 4.1.10-17.31.amzn1.x86_64 #1 SMP Sat Oct 24 01:31:37 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
  • sssd1.12.2
kerberos
  • 1 1 个回答
  • 1346 Views

1 个回答

  • Voted
  1. Best Answer
    abbra
    2016-01-04T14:31:38+08:002016-01-04T14:31:38+08:00

    您想通过 RFC 6251 实现的目标是 MIT Kerberos 无法实现的,因为没有计划实施此方案。但是,从 MIT Kerberos 1.13 开始,通过支持 Microsoft 的 Active Directory 所支持的相同协议 MS-KKDCP,支持通过 HTTPS 代理 Kerberos。MS-KKDCP 的客户端也被反向移植到 RHEL 7 ( https://rhn.redhat.com/errata/RHSA-2015-0439.html )。

    该功能取决于客户端代理 Kerberos 流量的能力。在 RHEL 7/CentOS 7 上运行的 SSSD 应该能够做到这一点。我认为,Amazon Linux 没有此版本的 Kerberos 库,因此您的方法行不通。

    此外,Amazon 的 Simple AD 是使用 Heimdal kerberos 构建的 Samba AD。它也不支持 MS-KKDCP,因此不能用作 MS-KKDCP 代理。

    • 2

相关问题

  • 为 WSS Reporting Services 设置 Kerberos 身份验证所涉及的风险

  • 针对 Active Directory 对 OpenBSD 进行身份验证

  • MAC 10.4.11 & Win2k8

  • 有没有办法让 Kerberos 凭证委托两次?为什么不?

  • Windows 可以与 LDAP 集成吗?

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