前言
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
About
作者:畫星星高手
鏈接:https://www.jianshu.com/p/d8e23105e14d
來源:簡書
著作權歸作者所有。商業轉載請聯系作者獲得授權,非商業轉載請注明出處。