• CentOS7一些设置


    1.CentOS系统中,使用默认创建的用户执行sudo命令时终端提示以下信息:

    tom is not in the sudoers file. This incident will be reported.
    

    原因是CentOS默认创建的用户并没有sudo命令的执行权限,而且CentOS中也并不存在sudo用户组。
    提示信息中提到的sudoers file位于/etc/sudoers,使用root权限可对其进行修改,命令如下:

    su root
    vim /etc/sudoers
                     ...
                     ...
                     ...
    ## Allow root to run any commands anywhere
    root    ALL=(ALL)       ALL
    tom     ALL=(ALL)       ALL
                     ...
                     ...
                     ...
    

    2.CentOS7在登录界面用户列表中隐藏指定账号

    CentOS中有多个账户,不想禁用用户列表,也不想全显示,使用root权限修改对应用户文件,命令如下:

    vim /var/lib/AccountsService/users/<username> 
    [User]
    Language=zh_CN.utf8
    XSession=
    SystemAccount=true
    

    3.CentOS7修改开机等待时间

    使用root用户权限修改grub.cfg文件,命令如下:

    vim /boot/grub2/grub.cfg
                     ...
                     ...
                     ...
    terminal_output console
    if [ x$feature_timeout_style = xy ] ; then
      set timeout_style=menu
      set timeout=1 # 建议改成1秒钟
    # Fallback normal timeout code in case the timeout_style feature is
    # unavailable.
    else
      set timeout=1
    fi
                     ...
                     ...
                     ...
    
  • 相关阅读:
    用户与组
    初识linux
    权限管理
    认识vim 编辑器
    文件归档
    路由相关术语
    Access、Hybrid和Trunk
    #error作用
    交换芯片收发包的 DMA 实现原理
    linux网络学习
  • 原文地址:https://www.cnblogs.com/reggieqiao/p/13474898.html
Copyright © 2020-2023  润新知