i3 / i3lock

improved screen locker
https://i3wm.org/i3lock
BSD 3-Clause "New" or "Revised" License
920 stars 404 forks source link

'sudo i3lock' doesnt let unlock #307

Closed theCollectiv closed 3 years ago

theCollectiv commented 3 years ago

I'm submitting a…

[x ] Bug
[ ] Feature Request
[x] Other (Please describe in detail)

Current Behavior

sudo i3lock does not let you unlock the screen ...only switch off by hardware and restart possible but i3lock works fine

Expected Behavior

I was expecting that sudo i3lock behaves like i3lock ...an let u unlock the screen

Reproduction Instructions

Environment

Output of i3lock --version:

i3lock --version
i3lock: version 2.13 © 2010 Michael Stapelberg

Using Ubuntu 20.04

stapelberg commented 3 years ago

This is most likely a PAM issue, not an i3lock issue.

I don’t know how to make this work, and we generally recommend running i3lock as unprivileged user only.

theCollectiv commented 3 years ago

Thx for reply. So I guess there is no work around available (I don't know anything about PAM) Normally I wouldn't run into this issue ...but I had a script with sudo empowered (with i3lock and pm-suspend [needs sudo] in it). So I guess I got to break the script in two scripts to deal with it.

orestisfl commented 3 years ago

Works fine for me. Remember that sudo password (this is typically your password) != root user password

Note that by default Ubuntu has an invalid password field set for root, effectively making it impossible to login as root.

https://askubuntu.com/a/681739

Also, I don't know what you are trying to do but you could also launch i3lock with your normal user from inside your script: sudo -u <your username> i3lock