创建PAM配置文件

在RHEL8中,PAM的一些配置文件由authselect管理,/etc/pam.d/system-auth/etc/pam.d/password-auth分别是/etc/authselect/system-auth/etc/authselect/password-auth的符号链接。

由于不建议直接更改上述文件,因此我们计划复制默认配置文件的sssd并更改该配置文件,以定制系统的认证配置和行为。

配置文件创建方法如下(在以下实例中,配置文件名称为user-profile)

创建一个名为 user-profile 的自定义认证配置文件,并指定使用 SSSD 后端。这个命令会在 /etc/authselect/custom/ 目录下创建一个新的配置文件,具体路径为 /etc/authselect/custom/user-profile

[root@localhost ~]# authselect create-profile user-profile -b sssd
New profile was created at /etc/authselect/custom/user-profile

选择创建的配置文件

命令再次选择名为 custom/user-profile 的认证配置文件,并启用 with-silent-lastlog 选项,即启用静默最后登录消息功能。

[root@localhost ~]# authselect select custom/user-profile with-silent-lastlog
Profile "custom/user-profile" was selected.
The following nsswitch maps are overwritten by the profile:
- passwd
- group
- netgroup
- automount
- services

Make sure that SSSD service is configured and enabled. See SSSD documentation for more information.

生效配置

如果在选择配置文件之后更改了user-profile的PAM配置文件(system-authpassword-auth),需要执行下面的命令使其生效。使用此命令,会将/etc/authselect/custom/user-profile下的system-authpassword-auth设置反映在/etc/authselect/system-auth/etc/authselect/password-auth中。

[root@localhost ~]# authselect apply-changes
Changes were successfully applied.
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值