Script to log me into XFCE from different user/terminal [debian]
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Script to log me into XFCE from different user/terminal [debian]
Hi! I'm not even sure how to word the question so I'll be as detailed as possible.
This is what I want to accomplish: when the computer boots to XFCE login screen I ctrl+alt+F1 to tty0 and login as root. From there I want to run a script/command which will log me in as a different user back in XFCE (ctrl+alt+f7).
If it's a difficult question to answer then I'll be fine even with some hints and directions! I'm assuming that the gui screen (c+a+f7) is not simply tty6, right? Is it an x11 client? I love learning Linux! It greatly improves my programming skills!
Hi, welcome here.
First of all you need to give more details, like OS and version.
Next we would like to know if it was an auto-login to XFCE (with root) or something else. Probably you need to set an auto-login for a non-root user.
How is this XFCE was started at all? (manually or ??).
What do you want to achieve at all? (two running X servers for two different users, or ???)
XFCE doesn't auto login and I don't want it to for security purposes. XFCE starts... I don't know, by default? Oh........ My bad! Now I've realised that the login screen is not a part of XFCE at all! I don't know which application is responsible for the login screen. I'm running Debian 10.
So what I want to achieve is root logged in at tty0 and a regular user logged in to xfce at the gui screen. But all of that accomplished by just one manual root login at tty0! The regular user only logs in automatically if the root was logged in!
Is it even possible? Can a script running on root account log in a different user in a separate gui terminal?
Yes, I think it is possible. But every GUI needs a terminal, so for example root can be logged in on tty0 and other user can use (GUI) on tty1.
Or if XFCE was automatically started root need to use tty1 (Ctrl-Alt-F2).
If I understand your post: you do not need to do anything. You can use Ctrl-Alt-F1 Ctrl-Alt-F2 ... Ctrl-Alt-F8 to switch between terminals. One of them can be used for GUI (as regular user), the other for root login. In console (non-gui mode) Alt-F1...Alt-F8, but in GUI you need to use Ctrl too to switch.
I have tried to use dm-tool from the root console. Here's the result of the list-seats command:
Quote:
Seat0
CanSwitch=true
HasGuestAccount=false
But when I try to run
Quote:
dm-tool switch-to-user myusername
this is the error I get:
Quote:
Not running inside a display manager, XDG_SEAT_PATH not defined
I feel like I'm getting close! Please help!
EDIT: So I changed the env variable and now when I run the command it switches the screen to lightdm login screen but it doesn't login automatically! It seems that dm-tool doesn't allow me to provide the password at all for my user anyway so I don't think it's the right direction :'(
I don't know if it is possible to provide login credentials to a display manager versus automatic login.
As an alternative, you can disable graphical mode, login in as root and then start a desktop as a regular user. If you want a display manager you can also run a second x server.
You need to modify the /etc/X11/Xwrapper.config and modify/add the following
allowed_users=anybody
needs_root_rights=yes
Once you login as root you can start the desktop as your regular user using the command.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.