签到成功

知道了

CNDBA社区CNDBA社区

redhat7 su切换用户时,不显示last login信息

2017-03-21 18:15 4443 0 原创 Linux
作者: Expect-乐

问题描述:

切换用户时,会出现红色部分的提示信息。有时候会影响之前脚本的正常运行,如何去掉它。

[root@rac1 ~]# su - oracle

http://www.cndba.cn/Expect-le/article/1817

Last login: Tue Mar 21 17:44:11 CST 2017

解决方法:

修改 /etc/pam.d/su文件

将红色部分注释掉即可http://www.cndba.cn/Expect-le/article/1817

[root@rac1 ~]# cat /etc/pam.d/suhttp://www.cndba.cn/Expect-le/article/1817

#%PAM-1.0

auth sufficient pam_rootok.sohttp://www.cndba.cn/Expect-le/article/1817

# Uncomment the following line to implicitly trust users in the "wheel" group.

#auth sufficient pam_wheel.so trust use_uid

# Uncomment the following line to require a user to be in the "wheel" group.

#auth required pam_wheel.so use_uidhttp://www.cndba.cn/Expect-le/article/1817

auth substack system-auth

auth include postlogin

account sufficient pam_succeed_if.so uid = 0 use_uid quiethttp://www.cndba.cn/Expect-le/article/1817http://www.cndba.cn/Expect-le/article/1817

account include system-authhttp://www.cndba.cn/Expect-le/article/1817

password include system-auth

session include system-auth

#session include postloginhttp://www.cndba.cn/Expect-le/article/1817

session optional pam_xauth.so

验证:

[root@rac1 ~]# su - oracle

http://www.cndba.cn/Expect-le/article/1817

[oracle@rac1 ~]$ 


 

版权声明:本文为博主原创文章,未经博主允许不得转载。

su last login

用户评论
* 以下用户言论只代表其个人观点,不代表CNDBA社区的观点或立场
Expect-乐

Expect-乐

关注

Without the continuous bitter cold, there can be no fragrant plum blossom

  • 336
    原创
  • 6
    翻译
  • 100
    转载
  • 41
    评论
  • 访问:1950162次
  • 积分:1957
  • 等级:核心会员
  • 排名:第4名
精华文章
    热门文章
      Copyright © 2016 All Rights Reserved. Powered by CNDBA · 皖ICP备2022006297号-1·

      AI QQ群