小编txw*_*ing的帖子

chsh:PAM 认证失败

我想更改默认的 shell env

chsh -s /bin/zsh以root用户身份运行,

但是出现了一条错误消息:chsh: PAM authentication failed

我发现这个线程http://ubuntuforums.org/showthread.php?t=1702833

但答案并没有解决我的问题

任何帮助,将不胜感激


这是/etc/pam.d/chsh的内容

#
# The PAM configuration file for the Shadow `chsh' service
#

# This will not allow a user to change their shell unless
# their current one is listed in /etc/shells. This keeps
# accounts with special shells from changing them.
auth       required   pam_shells.so

# This allows root to change user shell without being
# prompted for a password
auth …
Run Code Online (Sandbox Code Playgroud)

linux shell bash

18
推荐指数
2
解决办法
3万
查看次数

Puppet&Hiera:$variable 在访问时不是散列或数组

我使用的是 Puppet 3.2.2 和 Hiera 1.2.1。我写了一个 puppet 模块,init.pp 的内容是:

class install(
  $common_instanceconfig = hiera_hash('common_instanceconfig'),
  $common_instances = hiera('common_instances')
)
{

  define instances {

    common { $title:
      name       => $title,
      path       => $common_instanceconfig[$title]['path'],
      version    => $common_instanceconfig[$title]['version'],
      files      => $common_instanceconfig[$title]['files'],
      pre        => $common_instanceconfig[$title]['pre'],
      after      => $common_instanceconfig[$title]['after'],
      properties => $common_instanceconfig[$title]['properties'],
      require    => $common_instanceconfig[$title]['require'] ,

    }
  }

  instances {$common_instances:}
}
Run Code Online (Sandbox Code Playgroud)

而 hieradata 文件是:

classes:
  - install

common_instances:
  - common_instance_1
  - common_instance_2

common_instanceconfig:
  common_instance_1
    path      : '/opt/common_instance_1'
    version   : 1.0
    files     : software-1.bin
    pre       : pre_install.sh …
Run Code Online (Sandbox Code Playgroud)

puppet hiera

6
推荐指数
1
解决办法
8168
查看次数

如何使用logstash解析audit.log

我想用logstash收集一个日志文件,文件格式是这样的:

type=USER_START msg=audit(1404170401.294:157): user pid=29228 uid=0 auid=0 ses=7972 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='op=PAM:session_open acct="root" exe="/usr/sbin/crond" hostname=? addr=? terminal=cron res=success'
Run Code Online (Sandbox Code Playgroud)

我应该使用哪个过滤器来匹配该行?或者有另一种方法来处理它。

任何帮助,将不胜感激。


使用下面的模式将行与grok debugger匹配,但仍然收到一条No matches消息。

type=%{WORD:audit_type} msg=audit\(%{NUMBER:audit_epoch}:%{NUMBER:audit_counter}\): user pid=%{NUMBER:audit_pid} uid=%{NUMBER:audit_uid} auid=%{NUMBER:audit_audid} subj=%{WORD:audit_subject} msg=%{GREEDYDATA:audit_message}
Run Code Online (Sandbox Code Playgroud)

但是当我删除时subj=%{WORD:audit_subject} msg=%{GREEDYDATA:audit_message},它成功并得到了一个这样的 JSON 对象。

{
  "audit_type": [
    [
      "USER_END"
    ]
  ],
  "audit_epoch": [
    [
      "1404175981.491"
    ]
  ],
  "BASE10NUM": [
    [
      "1404175981.491",
      "524",
      "1465",
      "0",
      "0"
    ]
  ],
  "audit_counter": [
    [
      "524"
    ]
  ],
  "audit_pid": [
    [
      "1465"
    ]
  ],
  "audit_uid": [
    [
      "0"
    ]
  ], …
Run Code Online (Sandbox Code Playgroud)

audit logstash

4
推荐指数
1
解决办法
2万
查看次数

标签 统计

audit ×1

bash ×1

hiera ×1

linux ×1

logstash ×1

puppet ×1

shell ×1