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

Pheezy's questions

Martin Hope
Pheezy
Asked: 2009-09-23 07:09:17 +0800 CST

如何让 /var/log/messages 使用 FQDN 而不是短主机名?

  • 1

我注意到,即使我在 CLI 中键入“主机名”,也会显示 FQDN,但是似乎使用短名称的唯一文件是 /var/log/messages。我更喜欢它使用 FQDN,但我似乎无法弄清楚如何做到这一点。

syslog
  • 2 个回答
  • 1696 Views
Martin Hope
Pheezy
Asked: 2009-08-26 18:47:03 +0800 CST

如何让 puppet 为虚拟用户部署 ssh 密钥?

  • 8

我试图让 puppet 为虚拟用户分配授权的 ssh 密钥,但我不断收到以下错误:

err: Could not retrieve catalog: Could not parse for environment production: Syntax error at 'user'; expected '}' at /etc/puppet/modules/users/manifests/ssh_authorized_keys.pp:9

我相信我的配置是正确的(如下所列),但我是否缺少语法错误或范围问题?我只想将用户分配给节点,并让这些用户自动安装他们的 ssh 密钥。有没有更好的方法可以做到这一点,而我只是想多了?

# /etc/puppet/modules/users/virtual.pp

class user::virtual {
  @user { "user":
    home => "/home/user",
        ensure => "present",
        groups => ["root","wheel"],
        uid => "8001",
        password => "SCRAMBLED",
        comment => "User",
        shell => "/bin/bash",
    managehome => "true",
  }

# /etc/puppet/modules/users/manifests/ssh_authorized_keys.pp

ssh_authorized_key { "user":
  ensure => "present",
  type => "ssh-dss",
  key => "AAAAB....",
  user => "user",
}


# /etc/puppet/modules/users/init.pp

import "users.pp"
import "ssh_authorized_keys.pp"

class user::ops inherits user::virtual {
        realize(
                User["user"],
        )
}

# /etc/puppet/manifests/modules.pp

import "sudo"
import "users"

# /etc/puppet/manifests/nodes.pp

node basenode {
  include sudo
}

node 'testbox' inherits basenode {
  include user::ops 
}

# /etc/puppet/manifests/site.pp

import "modules"
import "nodes"

# The filebucket option allows for file backups to the server
filebucket { main: server => 'puppet' }

# Set global defaults - including backing up all files to the main filebucket and adds a global path
File { backup => main }
Exec { path => "/usr/bin:/usr/sbin/:/bin:/sbin" }
puppet
  • 4 个回答
  • 18997 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