Debian配置默认不开启图形界面
前言 Linux的图形界面实在是太耗资源了,同时开几个虚拟机感觉已经hold不住了,赶紧把这些Linux服务器的图形界面都关掉。 CLI:command Line Interface,命令行界面。 现在的Linux发行版默认登陆界面几乎都是默认为GUI界面,如果按照旧版本的修改inittab文件,在一些比较新的版本是没有这个文件的(Linux的启动服务机制发生改变) 修改Grub配置文件 打开gr
目录3 个章节
前言
Linux的图形界面实在是太耗资源了,同时开几个虚拟机感觉已经hold不住了,赶紧把这些Linux服务器的图形界面都关掉。
CLI:command Line Interface,命令行界面。 现在的Linux发行版默认登陆界面几乎都是默认为GUI界面,如果按照旧版本的修改inittab文件,在一些比较新的版本是没有这个文件的(Linux的启动服务机制发生改变)
修改Grub配置文件
打开grup配置文件
nano /etc/default/grub
修改
GRUB_CMDLINE_LINUX=”” 为GRUB_CMDLINE_LINUX=”text”
更新grub
update-grub
更新系统服务管理器配置
systemctl set-default multi-user.target
重启:init 6
# If you change this file, run ‘update-grub’ afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n ‘Simple configuration’
GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=lsb_release -i -s 2> /dev/null || echo Debian
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX="text"
# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD …)
#GRUB_BADRAM=”0x01234567,0xfefefefe,0x89abcdef,0xefefefef”
# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo’
#GRUB_GFXMODE=640x480
# Uncomment if you don’t want GRUB to pass “root=UUID=xxx” parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true
# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY=”true”
# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE=”480 440 1”
解除debian root用户登陆限制
打开gdm配置文件:
nano /etc/gdm3/deamon.conf
配置安全设置:
[security] 下一行添加 AllowRoot = ture
去除gdm登陆用户名检测:
打开文件 /etc/pam.d/gdm-autologin,并其相关配置信息删除或注释掉:auth required pam_succeed_if.so user != root quiet_success
修改后的gdm-autologin文件:
#%PAM-1.0
auth requisite pam_nologin.so
#auth required pam_succeed_if.so user != root quiet_success
auth required pam_permit.so
@include common-account
# SELinux needs to be the first session rule. This ensures that any
# lingering context has been cleared. Without this it is possible
# that a module could execute code in the wrong domain.
session [success=ok ignore=ignore module_unknown=ignore default=bad] pam_selinux.so close
session required pam_loginuid.so
# SELinux needs to intervene at login time to ensure that the process
# starts in the proper default security context. Only sessions which are
# intended to run in the user’s context should be run after this.
session [success=ok ignore=ignore module_unknown=ignore default=bad] pam_selinux.so open
session optional pam_keyinit.so force revoke
session required pam_limits.so
session required pam_env.so readenv=1
session required pam_env.so readenv=1 envfile=/etc/default/locale
@include common-session
@include common-password
_EOF_
Debian配置默认不开启图形界面
- 本文作者:
- 程序设计实验室
- 版权声明:
- 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
相关文章
别再手动复制SSH公钥了,Linux服务器一键从GitHub快速导入公钥
输入GitHub用户名就自动导入SSH公钥?Ubuntu这懒人功能挺省事。原理不就是爬取`https://github.com/用户名.keys`吗?手动用`curl`也能实现,装`ssh-import-id`更高效,但谁稀罕这些花里胡哨的。
2026-03-11 · 系统配置 · 约 1 分钟
内存不够用?在Linux上使用swapfile配置交换空间
前言 几个月前我还兴高采烈写了篇文章说给笔记本升级了内存配置,从乞丐版的4G一跃成为16G高富帅,然而,这几个月来我备受电脑死机的折磨,我现在有理由怀疑我可能买了假的内存条,于是没有办法,只能换回原厂的4G内存条,~~(然后准备赚部台式机)~~,问题不大。 换上4G内存条之后效果显著,只开了一个谷歌浏览器,内存占用就已经到了80%了,JB家的IDE是决计不敢再用了,可是这样还是难以满足系统对内存空
2025-10-27 · 系统配置 · 约 1 分钟
关闭CentOS-6-防火墙,关闭Linux系统防火墙
前言 最近部署服务的时候需要临时关闭一下防火墙,所以记个笔记,如何关闭CentOS防火墙。 查看系统版本 输入:cat /etc/issue 查看版本 通过service关闭 service命令开启以及关闭防火墙为即时生效,下次重启机器的时候会自动复原。 查看防火墙状态: service iptables status 记得在CentOS6.9中是输入iptables,网上有些教程使用serv
2025-10-27 · 系统配置 · 约 1 分钟
Ubuntu-16-04-升级Python版本到3-6
前言 没办法,unity桌面实在是太好用了,Ubuntu18.04上安装了unity桌面毕竟不够完美,所以我昨天就降级到Ubuntu16.04,享受一波原生Unity桌面的快感。 一切都OK,不过Python版本有点低,所以要用万能PPA源升级一下。 操作 安装Python3.6 sudo add-apt-repository ppa:jonathonf/python-3.6 sudo apt-g
2025-10-27 · 系统配置 · 约 1 分钟
讨论
共 0 条加载评论中…