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
                 ...
                 ...
                 ...

相关文章:

  • 2021-08-08
  • 2021-11-20
  • 2021-07-30
  • 2022-02-16
  • 2021-11-16
  • 2022-02-18
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-25
  • 2022-12-23
  • 2021-06-24
  • 2021-08-08
  • 2021-11-19
  • 2021-11-21
  • 2021-04-01
相关资源
相似解决方案