签到成功

知道了

CNDBA社区CNDBA社区

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

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

问题描述:

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

[root@rac1 ~]# su - oraclehttp://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.0http://www.cndba.cn/Expect-le/article/1817

auth sufficient pam_rootok.so

# 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_uid

auth substack system-auth

auth include postlogin

account sufficient pam_succeed_if.so uid = 0 use_uid quiet

account include system-auth

password include system-auth

session include system-auth

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

#session include postlogin

session optional pam_xauth.sohttp://www.cndba.cn/Expect-le/article/1817

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

验证:

[root@rac1 ~]# su - oracle

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

[oracle@rac1 ~]$ http://www.cndba.cn/Expect-le/article/1817


 

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

su last login

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

Expect-乐

关注

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

  • 336
    原创
  • 6
    翻译
  • 100
    转载
  • 41
    评论
  • 访问:1370240次
  • 积分:1957
  • 等级:核心会员
  • 排名:第3名
精华文章
    最新问题
    查看更多+
    热门文章
      热门用户
      推荐用户
        Copyright © 2016 All Rights Reserved. Powered by CNDBA · 皖ICP备2022006297号-1·

        QQ交流群

        注册联系QQ