zoukankan      html  css  js  c++  java
  • linux 常用命令: runuser

    rpm: coreutils-8.4-9.el6.x86_64

    runuser --help
    用法:runuser [选项]... [-] [用户 [参数]... ]
    Change the effective user id and group id to that of USER.  Only session PAM
    hooks are run, and there is no password prompt.  This command is useful only
    when run as the root user.  If run as a non-root user without privilege
    to set user ID, the command will fail as the binary is not setuid.
    As runuser doesn't run auth and account PAM hooks, it runs with lower overhead
    than su.
    
      -, -l, --login               make the shell a login shell, uses runuser-l
                                   PAM file instead of default one
      -g --group=group             specify the primary group
      -G --supp-group=group        specify a supplemental group
      -c, --command=COMMAND        pass a single COMMAND to the shell with -c
      --session-command=COMMAND    pass a single COMMAND to the shell with -c
                                   and do not create a new session
      -f, --fast                   pass -f to the shell (for csh or tcsh)
      -m, --preserve-environment   do not reset environment variables
      -p                           same as -m
      -s, --shell=SHELL            run SHELL if /etc/shells allows it
          --help        显示此帮助信息并退出
          --version        显示版本信息并退出
    
    单独的"-"选项隐含了-l。如果不指定用户,则假设其为root。
    
    请向bug-coreutils@gnu.org 报告runuser 的错误
    GNU coreutils 项目主页:<http://www.gnu.org/software/coreutils/>
    GNU 软件一般性帮助:<http://www.gnu.org/gethelp/>
    请向<http://translationproject.org/team/zh_CN.html> 报告runuser 的翻译错误
    要获取完整文档,请运行:info coreutils 'runuser invocation'

    使用:

    # For SELinux we need to use 'runuser' not 'su'
    if [ -x "/sbin/runuser" ]; then
        SU="/sbin/runuser -s /bin/sh"
    else
        SU="/bin/su -s /bin/sh"
    fi
  • 相关阅读:
    SqlServer实现Oracle的wm_concat()函数功能
    WebApi异常过滤器
    C#DataTable转List<Models>
    C#访问Oracle或SqlServer数据库遍历添加参数
    C#+.netFrameWork4.5.2+WebAPI+Jquery+Ajax跨域请求问题
    VS2015+Windows服务简易教程+文件夹监听
    C# rpt 批量打印写法
    C#model序列化xml
    oracle em无法连接数据库实例
    childNodes与children
  • 原文地址:https://www.cnblogs.com/doscho/p/6498148.html
Copyright © 2011-2022 走看看