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

Kingindanord's questions

Martin Hope
Kingindanord
Asked: 2021-04-05 15:41:50 +0800 CST

允许用户重新启动服务

  • 0

我正在尝试在没有 root 身份的情况下重新启动服务。这是正在使用命令的代码片段

template {
  source      = "{{vault_template_dir}}/agent.crt.tpl"
  destination = "{{vault_tls_dir}}/agent.crt"
  command     = "/usr/bin/systemctl restart vault.service"
}

在研究和阅读了类似的问题之后,我尝试通过编辑/etc/sudoers文件并添加以下行来为我使用的组(user=vault,group=vault)提供一个有限的 sudo 命令:

%vault ALL=(root) NOPASSWD: /usr/bin/systemctl restart vault.service

但是,当我尝试运行命令时仍然出现错误。错误日志文件:

Apr  4 23:27:41 xxxxxx vault[133973]: Failed to restart vault.service: Interactive authentication required.

保险库服务

[Unit]
After=network.service hostname.service consul-init.service consul.service
Description="Hashicorp Vault - A tool for managing secrets"
Documentation=https://www.vaultproject.io/docs/
StartLimitInterval=200
StartLimitBurst=5

[Service]
User=vault
Group=vault
ExecStart=/usr/bin/vault server -config="{{vault_server_config_file}}"
ExecReload=/usr/bin/kill -HUP $MAINIP
CapabilityBoundingSet=CAP_SYSLOG CAP_IPC_LOCK
LimitNOFILE=65536
LimitMEMLOCK=infinity
Restart=always
RestartSec=30

[Install]
WantedBy=multi-user.target

有人可以帮我解决这个问题吗?

sudo systemd systemctl
  • 1 个回答
  • 319 Views
Martin Hope
Kingindanord
Asked: 2020-08-11 00:17:14 +0800 CST

dnsmasq - 防止解析不存在的主机

  • 0

我已经在 ubuntu 实例上安装了 dnsmasq DNS 服务器,并在配置中添加了域名。它工作正常,只是它以与域名相同的方式解析未知主机。

这是我的配置:

/etc/dnsmasq.conf

# domain name
domain=example.com
local=/example.com/

address=/example.com/127.0.0.1 
listen-address=127.0.0.1

/etc/hosts

127.0.0.1 localhost
172.217.16.195 www.google.com
10.10.1.x testhost

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

我已经在“示例”实例上安装了 nginx 服务器,所以当我向端口 80 发送 GET 请求时,我希望看到默认页面,这是按计划工作的:

curl example.com

<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
...

在“testhost”实例上,我安装了返回“hello world”的简单服务器,这也可以正常工作。

curl testhost.example.com

hello world

但是,当我请求一个不存在的主机时,它会被重定向到“示例”主机: curl random-string-asfasfasfasf.example.com

<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
...

我怎样才能防止这种行为?

internal-dns dnsmasq
  • 1 个回答
  • 155 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