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
                 ...
                 ...
                 ...
posted @ 2020-08-11 12:44  Nicoqiao  阅读(206)  评论(0编辑  收藏  举报