ubuntu20.04桌面允许root用户登录

root@node11:~# vi /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf

Seat:\*

user-session=ubuntu
greeter-show-manual-login=true
all-guest=false

"/usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf" 4L, 76C written

root@node11:~# vi /etc/pam.d/gdm-autologin

#%PAM-1.0

auth requisite pam_nologin.so
#auth required pam_succeed_if.so user != root quiet_success

auth optional pam_gdm.so

auth optional pam_gnome_keyring.so

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 user_readenv=1 envfile=/etc/default/locale

@include common-session

session optional pam_gnome_keyring.so auto_start

@include common-password

~

"/etc/pam.d/gdm-autologin" 23L, 1193C written

root@node11:~# vi /etc/pam.d/gdm-password

#%PAM-1.0

auth requisite pam_nologin.so
#auth required pam_succeed_if.so user != root quiet_success

@include common-auth

auth optional pam_gnome_keyring.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.

pam_selinux.so changes the SELinux context of the used TTY and configures

SELinux in order to transition to the user context with the next execve()

call.

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 user_readenv=1 envfile=/etc/default/locale

@include common-session

session optional pam_gnome_keyring.so auto_start

@include common-password

"/etc/pam.d/gdm-password" 25L, 1321C written

root@node11:~# vi /root/.profile

~/.profile: executed by Bourne-compatible login shells.

if "$BASH" ; then

if -f \~/.bashrc ; then

. ~/.bashrc

fi

fi

#mesg n 2> /dev/null || true
tty -s && mesg n || true

. "$HOME/.cargo/env"

~

~

~

~

~

".profile" 12L, 209C written

root@node11:~#

参考:

https://comate.baidu.com/zh/page/ug2pso36mvo

相关推荐
牢姐与蒯7 分钟前
Linux信号(二).信号产生续 && 信号保存
linux·运维·服务器·ubuntu
-madongyu-7 分钟前
GaussDB SQL 执行引擎:查询重写、优化器与执行器
数据库·sql·gaussdb
oradh10 分钟前
Oracle SQL Tuning Advisor调优工具
数据库·sql·oracle
皓月盈江12 分钟前
WordPress博客迁移到Hexo静态博客教程
linux·服务器·hexo·wordpress·博客迁移·静态博客
鬼手点金28 分钟前
Claude Code示范案例-修复 Bug 工作流
java·服务器·前端·javascript·bug·openclaw
一条破秋裤28 分钟前
Linux 进程通信介绍:内存隔离与 IPC 分类
java·linux·服务器
Omics Pro31 分钟前
空间组学!医学代谢显微工具
数据库·人工智能·算法·机器学习·自然语言处理
Yyyyyy~37 分钟前
[mysql]day1
数据库·mysql
Elastic 中国社区官方博客39 分钟前
两个依赖和一个配置块:通过 Prometheus 远程写入将 Spring Boot 指标发送到 Elasticsearch
大数据·数据库·spring boot·elasticsearch·搜索引擎·全文检索·prometheus
JosieBook41 分钟前
【数据库】MySQL 实战精通系列 · 第2篇:数据建模与建表实战
android·数据库·mysql