You are not logged in.
Hi,
how can I prevent Users to log in to Xfce?
I`m using Debian and changed the /etc/passwd file user entry, for example as this:
user7:x:1003:1019:user7,,,:/home/user7:/sbin/nologin
/sbin/nologin is used to prevent user to login:
https://www.cyberciti.biz/tips/linux-pr … ystem.html
But if I use user7 for login on my system, I still can login in Xfce...
How can I prevent this?
Thank you very much in advance,
cheers
Maria
Offline
Try to comment the line :
#user7:x:1003:1019:user7,,,:/home/user7:/bin/bash
In my debian system, nologin is in /usr/sbin/
but it prevent only to login in TTY (Ctrl+Alt+F3).
Offline
Hi, ctac, thank you for answering..
I forgot to mention, that I just need to prevent LOGIN of the User, but not to deactivate the user!
Explanation:
I have a SAMBA server running on Debian and my users are accessing the files and folders of the server using Windows Clients.
So I would of course let the User to access the Files over SAMBA, but NOT to login to the system over the xfce login Mask...
If I commtent the User, he will not be able to access the Files over Samba...
I`m sure there must be a solution for this, but all my Google research did not give me anything... ;(
Hopefully this community here can help me
Thanks and cheers,
Maria
Offline
Can't find a way via Xsession or Xinit so if you start your session with lightdm, you can try this way.
In lightdm.conf after [Seat:*], add a line :
session-setup-script =/etc/lightdm/start_user_session.sh
Create a file /etc/lightdm/start_user_session.sh like this one :
if ( test $(sed '/^'"$USER"':/!d;s/.*://' '/etc/passwd') = "/bin/false" ) ; then
xmessage -bg black -fg blue -center -title 'Information' -buttons 'sorry' -geometry 800x100 "Hello and welcome $USER , you are not allowed to login" -timeout 5
pkill $(ps -C xfce4-session -o pid=)
fi
Offline
Come back with another answer.
with :
uname -a
Linux debian-linux 4.19.0-2-amd64 #1 SMP Debian 4.19.16-1 (2019-01-17) x86_64 GNU/Linux
All is explain in man 5 Xsession DEFAULT STARTUP PROCEDURE SUPPLIED SCRIPTS
With a shell set to /bin/false in /etc/passwd and a file named /etc/X11/Xsession.d/10_valid_user_launch
cat /etc/X11/Xsession.d/10_valid_user_launch
# deny user with SHELL=/bin/false to log in Xsession
if ( test $(sed '/^'"$USER"':/!d;s/.*://' '/etc/passwd') = "/bin/false" ) ; then
errormsg "Hello and welcome $USER , you are not allowed to login"
fi
Offline
Hi, ctac
Sorry for not Answering, was blown away by the flue... ;(
Great! I`ll try that, Thanks.. :*
Offline
You can take a look at this thread, too:
Offline
[ Generated in 0.012 seconds, 8 queries executed - Memory usage: 535.61 KiB (Peak: 536.45 KiB) ]