plasma 5, kde 5, kubuntu 15.04 使用root用户登录,看这里来。
kubuntu 15.04 开始用sddm来替代kdm,登录的时候要用root用户登录?
Easy!
~#cat /etc/sddm.conf
[Autologin]
Relogin=false
Session=
User=
[General]
HaltCommand=
RebootCommand=
[Theme]
CursorTheme=breeze_cursors
[Users]
HideShells=/sbin/nologin,/bin/false
# Hidden users, this is if any system users fall within your range, see /etc/passwd on your system.
HideUsers=daemon bin sys sync man lp mail news uucp proxy www-data backup list irc gnats nobody syslog messagebus colord lightdm avahi-autoipd avahi usbmux kernoops rtkit whoopsie speech-dispatcher hplip saned mysql sshd festival dnsmasq dhcpd gdm pulse postfix xrdp firebird vnstat ntpd usermetrics uuidd icecast2 minidlna ntop memcache systemd-timesync systemd-network systemd-resolve systemd-bus-proxy sddm
# Maximum user id for displayed users, 随便啦,不用别的用户都可以用1
MaximumUid=65000
# Minimum user id for displayed users, root 用户是0最小ID得为0
MinimumUid=0
光这样当然不行了。
~#cat /etc/pam.d/sddm
#%PAM-1.0
# Block login if they are globally disabled
auth requisite pam_nologin.so
# auth required pam_succeed_if.so user != root nopasswdlogin 重点是这里注释了这行,换成了下面这行
auth sufficient pam_succeed_if.so user ingroup nopasswdlogin
# auth sufficient pam_succeed_if.so user ingroup nopasswdlogin
@include common-auth
-auth optional pam_gnome_keyring.so
-auth optional pam_kwallet.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
# Create a new session keyring.
session optional pam_keyinit.so force revoke
session required pam_limits.so
session required pam_loginuid.so
@include common-session
# 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_gnome_keyring.so auto_start
-session optional pam_kwallet.so auto_start
@include common-password
# From the pam_env man page
# Since setting of PAM environment variables can have side effects to other modules, this module should be the last one on the stack.
# Load environment from /etc/environment
session required pam_env.so
# Load environment from /etc/default/locale
session required pam_env.so envfile=/etc/default/locale
替换了文件的第五行
当然root用户得设置好密码才行
然后重启,或者pkill sddm 就ok了。
相关文章:
Ubuntu 12.04 root用户登录设置:http://www.linuxdiyf.com/linux/3840.html
Ubuntu 12.10设置root用户登录图形界面:http://www.linuxdiyf.com/linux/1474.html
PAM禁止root用户登录,限制普通su切换:http://www.linuxdiyf.com/linux/11390.html