东方即白 發表於 2020-4-23 20:09:00

Debian(kali)配置默认不开启图形界面

<p>前言<br>
Linux的图形界面实在是太耗资源了,同时开几个虚拟机感觉已经hold不住了,赶紧把这些Linux服务器的图形界面都关掉。</p>
<p>CLI:command Line Interface,命令行界面。<br>
现在的Linux发行版默认登陆界面几乎都是默认为GUI界面,如果按照旧版本的修改inittab文件,在一些比较新的版本是没有这个文件的(Linux的启动服务机制发生改变)</p>
<p>修改Grub配置文件<br>
打开grup配置文件</p>
<p>nano /etc/default/grub<br>
修改</p>
<p>GRUB_CMDLINE_LINUX=”” 为GRUB_CMDLINE_LINUX=”text”<br>
更新grub</p>
<p>update-grub<br>
更新系统服务管理器配置</p>
<p>systemctl set-default multi-user.target<br>
重启:init 6</p>
<h1 id="if-you-change-this-file-run-update-grub-afterwards-to-update">If you change this file, run ‘update-grub’ afterwards to update</h1>
<h1 id="bootgrubgrubcfg">/boot/grub/grub.cfg.</h1>
<h1 id="for-full-documentation-of-the-options-in-this-file-see">For full documentation of the options in this file, see:</h1>
<h1 id="info--f-grub--n-simple-configuration">info -f grub -n ‘Simple configuration’</h1>
<p>GRUB_DEFAULT=0<br>
GRUB_TIMEOUT=5<br>
GRUB_DISTRIBUTOR=lsb_release -i -s 2&gt; /dev/null || echo Debian<br>
GRUB_CMDLINE_LINUX_DEFAULT="quiet"<br>
GRUB_CMDLINE_LINUX="text"</p>
<h1 id="uncomment-to-enable-badram-filtering-modify-to-suit-your-needs">Uncomment to enable BadRAM filtering, modify to suit your needs</h1>
<h1 id="this-works-with-linux-no-patch-required-and-with-any-kernel-that-obtains">This works with Linux (no patch required) and with any kernel that obtains</h1>
<h1 id="the-memory-map-information-from-grub-gnu-mach-kernel-of-freebsd-">the memory map information from GRUB (GNU Mach, kernel of FreeBSD …)</h1>
<h1 id="grub_badram0x012345670xfefefefe0x89abcdef0xefefefef">GRUB_BADRAM=”0x01234567,0xfefefefe,0x89abcdef,0xefefefef”</h1>
<h1 id="uncomment-to-disable-graphical-terminal-grub-pc-only">Uncomment to disable graphical terminal (grub-pc only)</h1>
<h1 id="grub_terminalconsole">GRUB_TERMINAL=console</h1>
<h1 id="the-resolution-used-on-graphical-terminal">The resolution used on graphical terminal</h1>
<h1 id="note-that-you-can-use-only-modes-which-your-graphic-card-supports-via-vbe">note that you can use only modes which your graphic card supports via VBE</h1>
<h1 id="you-can-see-them-in-real-grub-with-the-command-vbeinfo">you can see them in real GRUB with the command `vbeinfo’</h1>
<h1 id="grub_gfxmode640x480">GRUB_GFXMODE=640x480</h1>
<h1 id="uncomment-if-you-dont-want-grub-to-pass-rootuuidxxx-parameter-to-linux">Uncomment if you don’t want GRUB to pass “root=UUID=xxx” parameter to Linux</h1>
<h1 id="grub_disable_linux_uuidtrue">GRUB_DISABLE_LINUX_UUID=true</h1>
<h1 id="uncomment-to-disable-generation-of-recovery-mode-menu-entries">Uncomment to disable generation of recovery mode menu entries</h1>
<h1 id="grub_disable_recoverytrue">GRUB_DISABLE_RECOVERY=”true”</h1>
<h1 id="uncomment-to-get-a-beep-at-grub-start">Uncomment to get a beep at grub start</h1>
<h1 id="grub_init_tune480-440-1">GRUB_INIT_TUNE=”480 440 1”</h1>
<p>解除debian root用户登陆限制<br>
打开gdm配置文件:</p>
<p>nano /etc/gdm3/deamon.conf<br>
配置安全设置:<br>
下一行添加 AllowRoot = ture<br>
去除gdm登陆用户名检测:<br>
打开文件 /etc/pam.d/gdm-autologin,并其相关配置信息删除或注释掉:auth required pam_succeed_if.so user != root quiet_success</p>
<p>修改后的gdm-autologin文件:</p>
<h1 id="pam-10">%PAM-1.0</h1>
<p>auth requisite pam_nologin.so</p>
<h1 id="auth-required-pam_succeed_ifso-user--root-quiet_success">auth required pam_succeed_if.so user != root quiet_success</h1>
<p>auth required pam_permit.so<br>
@include common-account</p>
<h1 id="selinux-needs-to-be-the-first-session-rule-this-ensures-that-any">SELinux needs to be the first session rule. This ensures that any</h1>
<h1 id="lingering-context-has-been-cleared-without-this-it-is-possible">lingering context has been cleared. Without this it is possible</h1>
<h1 id="that-a-module-could-execute-code-in-the-wrong-domain">that a module could execute code in the wrong domain.</h1>
<p>session pam_selinux.so close<br>
session required pam_loginuid.so</p>
<h1 id="selinux-needs-to-intervene-at-login-time-to-ensure-that-the-process">SELinux needs to intervene at login time to ensure that the process</h1>
<h1 id="starts-in-the-proper-default-security-context-only-sessions-which-are">starts in the proper default security context. Only sessions which are</h1>
<h1 id="intended-to-run-in-the-users-context-should-be-run-after-this">intended to run in the user’s context should be run after this.</h1>
<p>session pam_selinux.so open<br>
session optional pam_keyinit.so force revoke<br>
session required pam_limits.so<br>
session required pam_env.so readenv=1<br>
session required pam_env.so readenv=1 envfile=/etc/default/locale<br>
@include common-session<br>
@include common-password<br>
About</p>
<p>作者:画星星高手<br>
链接:https://www.jianshu.com/p/d8e23105e14d<br>
来源:简书<br>
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。</p><br><br>
来源:https://www.cnblogs.com/mrhonest/p/12763215.html
頁: [1]
查看完整版本: Debian(kali)配置默认不开启图形界面