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

AlastairG's questions

Martin Hope
AlastairG
Asked: 2021-11-16 00:57:16 +0800 CST

CRON[83463]:设置用户凭据失败

  • 0

我有许多 docker 容器,它们的设置大多相同,它们成功地使用 cron 运行夜间备份作业。

我有另一个容器,设置基本相同,它尝试使用 cron 运行夜间备份作业,但失败了。

我安装了 rsyslog 以获取更多信息,当 cron 运行 root 的 crontab 时,我在 syslog 文件中看到以下条目:

CRON[83463]: Failure setting user credentials

此容器与所有其他容器之间的一个区别在于,此容器允许用户使用 LDAP 登录。它在 Dockerfile 中有以下额外的行:

RUN echo '*;*;*;Al0000-2400;svn' >> /etc/security/group.conf
COPY pam_group /usr/share/pam-configs/groups
RUN echo "session required        pam_mkhomedir.so skel=/etc/skel umask=077" >> /etc/pam.d/common-session
RUN sed -i 's#\(.*pam_ldap.so.*\)#auth    required     pam_group.so\n\1#' /etc/pam.d/common-auth
RUN sed -i 's#^passwd:.*#passwd:  files ldap systemd#;s#^group:.*#group:   files ldap systemd#;s#^shadow:.*#shadow:  files ldap#' /etc/nsswitch.conf

该pam_group文件如下所示:

Name: activate /etc/security/group.conf
Default: yes

Priority: 900
Auth-Type: Primary Auth:
        required                        pam_group.so

显然,有关设置 LDAP 并尝试确保将所有用户添加到svn组(根本不起作用)的一些事情破坏了 cron 的 root 用户会话。

我查看了整个互联网,但没有发现这个特定的错误。我已经尝试过相关的解决方案,但没有任何效果。

更新:

pam.d/common-auth 看起来像:

auth    [success=2 default=ignore]  pam_unix.so nullok_secure
auth    required     pam_group.so
auth    [success=1 default=ignore]  pam_ldap.so use_first_pass
# here's the fallback if no module succeeds
auth    requisite           pam_deny.so
# prime the stack with a positive return value if there isn't one already;
# this avoids us returning an error just because nothing sets a success code
# since the modules above will each just jump around
auth    required            pam_permit.so
# and here are more per-package modules (the "Additional" block)
auth    optional            pam_cap.so 

pam.d/cron 看起来像:

@include common-auth

# Sets the loginuid process attribute
session    required     pam_loginuid.so

# Read environment variables from pam_env's default files, /etc/environment
# and /etc/security/pam_env.conf.
session       required   pam_env.so

# In addition, read system locale information
session       required   pam_env.so envfile=/etc/default/locale

@include common-account
@include common-session-noninteractive 

# Sets up user limits, please define limits for cron tasks
# through /etc/security/limits.conf
session    required   pam_limits.so
cron ldap pam
  • 1 个回答
  • 237 Views
Martin Hope
AlastairG
Asked: 2021-01-16 05:14:10 +0800 CST

Step-CA 不适用于服务器备用名称 (SAN)

  • 0

使用 SAN 创建证书时 Step-CA 的帮助文本如下:

  Request a new certificate with multiple Subject Alternative Names. The
  Subject Common Name of the certificate will be 'foobar'. However, because
  additional SANs are configured using the --san flag and 'foobar' is not one
  of these, 'foobar' will not be in the SAN extensions of the certificate.
  The certificate will have 2 IP Address extensions (1.1.1.1, 10.2.3.4) and 1
  DNS Name extension (hello.example.com):

      $ step ca certificate --san 1.1.1.1 --san hello.example.com --san 10.2.3.4 foobar internal.crt internal.key

当我尝试如下等效命令时:

step ca certificate --san dtk --san dtk.intranet.local foobar /root/dtk.crt /root/dtk.key

我得到以下输出:

✔ Provisioner: acme-smallstep (ACME)
Using Standalone Mode HTTP challenge to validate dtk .. done!
Using Standalone Mode HTTP challenge to validate dtk.dynautics.local .. done!
Waiting for Order to be 'ready' for finalization .. done!
Finalizing Order .error finalizing order: error finalizing order: CSR names do not match identifiers exactly: CSR names = [dtk dtk.dynautics.local foobar], Order names = [dtk dtk.dynautics.local]

如果我用空字符串替换“foobar”,它会提示我输入主题。如果我将“foobar”替换为“dtk dtk.dynautics.local”作为单个字符串,我会得到:

Finalizing Order .error finalizing order: error finalizing order: CSR names do not match identifiers exactly: CSR names = [dtk dtk dtk.dynautics.local dtk.dynautics.local], Order names = [dtk dtk.dynautics.local]

我很困惑。SAN肯定是常见的东西吗?这个功能肯定是在 Step-CA 发布之前测试过的吗?

为什么他们自己的例子不起作用?

ssl-certificate
  • 1 个回答
  • 287 Views
Martin Hope
AlastairG
Asked: 2021-01-15 05:22:28 +0800 CST

如何为不合格的主机名配置 nginx?

  • 0

我正在将 nginx 设置为反向代理。我以前只使用过 Apache,并且没有使用虚拟主机。

我希望我的用户能够通过在地址栏中输入服务名称来访问各种 Intranet Web 服务。例如键入“timesheets”而不是“timesheets.intranet.local”。

在客户端计算机上,如果我使用“wget”或浏览器访问站点的 FQDN (timesheets.intranet.local),那么一切都很好。

在客户端计算机上,如果我使用“wget”或浏览器访问站点的纯主机名(时间表),那么它会失败。

如果我在 nginx 服务器机器上本地使用“wget”,那么两者都可以正常工作。

我的站点配置如下所示:

server {
  server_name timesheets timesheets.intranet.local;

  location / {
    proxy_pass http://127.0.0.1:8080;
  }

  listen [::]:443 ssl ipv6only=on;
  listen 443 ssl;
  ssl_certificate /root/timesheet.crt;
  ssl_certificate_key /root/timesheet.key;
}

名称解析不是问题。客户端计算机上的“wget”正确解析 IP 地址,但仍无法检索页面。

nginx
  • 1 个回答
  • 367 Views
Martin Hope
AlastairG
Asked: 2020-09-24 00:29:02 +0800 CST

如何使用 Apache 将主机名重定向到 docker 容器

  • 0

我目前有许多运行 docker 容器的小型 VM。虚拟机很小,因为它们太多,因此经常锁定,通常是在调用 S3 命令行工具时,但今天在尝试使用 wget 下载 DEB 文件时。

我这样做的原因是当时 docker 似乎是个好主意,每个迷你服务都有不同的主机名,但我想使用标准端口 (80/443),这样用户就不必记住自定义 URL , 只有主机名。

我受够了这些虚拟机的所有问题。我想转移到一个运行多个 docker 容器的强大服务器。但是,由于每个容器都使用端口 80 和端口 443,因此会出现端口冲突。

我不希望使用重定向,例如https://ldap.intranet.local被重定向到https://ldap.intranet.local:3000因为这会修改用户在浏览器中看到的 URL,我更喜欢这个100% 透明。

我目前的解决方案,我对其他人开放,是使用 Apache 通过主机名识别请求的能力,将请求转发到不同的端口。

即,如果请求进入https://ldap.intranet.local,Apache 会将其转发到https://127.0.0.1:3000,然后运行 ​​LDAP docker 容器,使外部端口 3000 映射到内部端口 443 . docker 容器内的 web 服务器然后会拾取它并处理它。

同样,当请求进入https://jenkins.intranet.local时,Apache 会将其转发到https://127.0.0.1:4000,并且 Jenkins docker 容器将运行使得外部端口 4000 映射到内部端口 443 . docker 容器内的 web 服务器然后会拾取它并处理它。

等等等等。

这可能吗?如果是这样,我该如何配置 Apache 来做到这一点?如果不是,我还能如何解决我的问题?

非常感谢您的帮助。

apache2 docker
  • 1 个回答
  • 2384 Views
Martin Hope
AlastairG
Asked: 2019-07-27 04:49:43 +0800 CST

如何在 Ubuntu 18 上安装 libmono.so?

  • 0

我正在尝试构建一些使用 CMake 查找并链接到 Mono 的代码。它正在尝试链接到libmono.so和libmono-2.0.so。

我已经安装了 mono-complete(它安装了 mono-devel)而没有错误,并且文件仍然不存在。在 mono-devel 上使用dpkg表明这些库不是安装的一部分。那么我从哪里得到它们呢?

使用locate显示一些 Steam 游戏具有库,因此它们显然存在......某处。

如何在我的机器上安装这些开发库?

ubuntu-18.04
  • 1 个回答
  • 904 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