centos

centos minimal如何设置自动登录

小樊
35
2025-08-14 13:58:40
栏目: 智能运维

CentOS Minimal 版本可通过修改系统服务配置实现自动登录,以下是具体步骤(以图形界面为例):

  1. 编辑 GDM 配置文件
    使用文本编辑器(如 vi)打开 /etc/gdm/custom.conf
    sudo vi /etc/gdm/custom.conf
    
  2. 启用自动登录
    [daemon] 部分添加以下内容(替换 <用户名> 为实际用户名):
    AutomaticLoginEnable=True
    AutomaticLogin=<用户名>
    
    示例(以 root 用户为例):
    AutomaticLoginEnable=True
    AutomaticLogin=root
    
  3. 重启系统生效
    保存文件后重启系统:
    sudo reboot
    

说明

0
看了该问题的人还看了