[已解决]如何让dm-tool在切换用户时不需手动登录?

各种窗口管理器和美化相关
回复
科学之子
帖子: 2284
注册时间: 2013-05-26 6:58
系统: Debian 9

[已解决]如何让dm-tool在切换用户时不需手动登录?

#1

帖子 科学之子 » 2016-12-09 18:44

如何让dm-tool在切换用户时不需手动登录?
我这就算目标用户的密码是empty也照样切换到greeter

感谢6楼
https://wiki.debian.org/DebianDesktopHowTo#GNOME
在"/etc/pam.d/lightdm"的开头加入:

代码: 全选

auth sufficient pam_succeed_if.so user ingroup nopasswdlogin
然后把需要切换得用户名加入nopasswdlogin组即可,没有nopasswdlogin组可参考wiki链接中添加
上次由 科学之子 在 2017-01-27 19:08,总共编辑 2 次。
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 如何让dm-tool在切换用户时不需手动登录?

#2

帖子 poloshiao » 2016-12-09 21:50

試試
設定自動登錄
科学之子
帖子: 2284
注册时间: 2013-05-26 6:58
系统: Debian 9

Re: 如何让dm-tool在切换用户时不需手动登录?

#3

帖子 科学之子 » 2016-12-09 23:51

poloshiao 写了:試試
設定自動登錄
已经有一个用户是自动登录了
现在的需求是我离开时按一个热键,自动切换到另一个用户,而非切换到greeter
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 如何让dm-tool在切换用户时不需手动登录?

#4

帖子 poloshiao » 2016-12-10 9:01

密码是empty
你如何確定 密码是 empty 而不是 space
科学之子
帖子: 2284
注册时间: 2013-05-26 6:58
系统: Debian 9

Re: 如何让dm-tool在切换用户时不需手动登录?

#5

帖子 科学之子 » 2016-12-10 11:29

poloshiao 写了:
密码是empty
你如何確定 密码是 empty 而不是 space
man passwd 的内容:

代码: 全选

-d, --delete
           Delete a user's password (make it empty). This is a quick way to disable a password for an account. It will set the named account passwordless.
然后照着做了,dm-tool还是只能切换到greeter,但greeter里面可以不输入密码直接回车登录
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 如何让dm-tool在切换用户时不需手动登录?

#6

帖子 poloshiao » 2016-12-10 15:37

http://manpages.ubuntu.com/manpages/xen ... ool.1.html
dm-tool - a tool to control the display manager
switch-to-user USERNAME [SESSION]
Switch to a user session.
If this user is already logged in then the display manager will switch to that session, otherwise a new session is started. If authentication is required a greeter will start to collect this. If the session option is provided then this session type will be used, otherwise the default for this user is used.

試試 取消 authentication 看看
把 username 加入 group nopasswdlogin
http://www.tuxgarage.com/2012/07/disabl ... login.html
sudo usermod -a -G nopasswdlogin <USERNAME>
科学之子
帖子: 2284
注册时间: 2013-05-26 6:58
系统: Debian 9

Re: 如何让dm-tool在切换用户时不需手动登录?

#7

帖子 科学之子 » 2016-12-10 20:33

poloshiao 写了:http://manpages.ubuntu.com/manpages/xen ... ool.1.html
dm-tool - a tool to control the display manager
switch-to-user USERNAME [SESSION]
Switch to a user session.
If this user is already logged in then the display manager will switch to that session, otherwise a new session is started. If authentication is required a greeter will start to collect this. If the session option is provided then this session type will be used, otherwise the default for this user is used.

試試 取消 authentication 看看
把 username 加入 group nopasswdlogin
http://www.tuxgarage.com/2012/07/disabl ... login.html
sudo usermod -a -G nopasswdlogin <USERNAME>

代码: 全选

username@debian:~$ sudo usermod -a -G nopasswdlogin p
[sudo] password for username: 
usermod: group 'nopasswdlogin' does not exist
猜测可能Debian的这些默认配置跟Ubuntu不一样
我在这个版区发帖是因为用的是LXDE,但发行版是Debian
科学之子
帖子: 2284
注册时间: 2013-05-26 6:58
系统: Debian 9

Re: 如何让dm-tool在切换用户时不需手动登录?

#8

帖子 科学之子 » 2016-12-10 21:00

https://wiki.debian.org/DebianDesktopHowTo#GNOME
难道单纯添加一个组就能"免密码"?这个组名难道是有什么特殊用途?
为什么默认没有这个组?

Sat Dec 10 21:10:05 CST 2016 补充:
仔细看了看链接中的英文介绍,貌似跟PAM有关
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 如何让dm-tool在切换用户时不需手动登录?

#9

帖子 poloshiao » 2016-12-11 7:16

为什么默认没有这个组?
1. 沒有就手動增加
http://www.debianadmin.com/manpages/use ... anpage.htm
groupadd - Create a new group

SYNOPSIS
groupadd [-g gid [-o]] group



2. Ubuntu 16.04 預裝就有
sudo cat /etc/group | grep nopasswdlogin
nopasswdlogin:x:112:
回复