LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 05-18-2020, 04:13 AM   #1
GavrielBA
LQ Newbie
 
Registered: May 2020
Distribution: Debian
Posts: 4

Rep: Reputation: Disabled
Question 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!
 
Old 05-18-2020, 06:43 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,803

Rep: Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306
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 ???)
 
Old 05-19-2020, 08:11 AM   #3
GavrielBA
LQ Newbie
 
Registered: May 2020
Distribution: Debian
Posts: 4

Original Poster
Rep: Reputation: Disabled
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?
 
Old 05-19-2020, 08:35 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,803

Rep: Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306
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).
 
Old 05-19-2020, 09:05 AM   #5
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,294
Blog Entries: 3

Rep: Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719
The Display Manager will be the package which handles the graphical logins. Check for slim, gdm, lightdm, or something similar.

I'm not sure you can get that to run a login session for you "remotely", but there might be a way.
 
Old 05-19-2020, 09:37 AM   #6
GavrielBA
LQ Newbie
 
Registered: May 2020
Distribution: Debian
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thanks for all the replies! Maybe I'm slow but I don't understand what to do exactly. Or where to look.

It looks like the display manager I have is lightdm
 
Old 05-19-2020, 09:43 AM   #7
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,803

Rep: Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306
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.
 
Old 05-19-2020, 12:53 PM   #8
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
Quote:
Originally Posted by GavrielBA View Post
It looks like the display manager I have is lightdm
For LightDM, there's dm-tool that allows you switching to a user session.
 
Old 05-22-2020, 02:36 PM   #9
GavrielBA
LQ Newbie
 
Registered: May 2020
Distribution: Debian
Posts: 4

Original Poster
Rep: Reputation: Disabled
Hello again!

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 :'(

Last edited by GavrielBA; 05-22-2020 at 03:04 PM.
 
Old 05-22-2020, 08:11 PM   #10
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,947

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
What's so tough about providing a user & password to login?
 
Old 05-22-2020, 10:28 PM   #11
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,679

Rep: Reputation: 5893Reputation: 5893Reputation: 5893Reputation: 5893Reputation: 5893Reputation: 5893Reputation: 5893Reputation: 5893Reputation: 5893Reputation: 5893Reputation: 5893
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.

su -l your_user -c startx
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: 179 Color Schemes For Your Gtk-Based Linux Terminal (Gnome Terminal, Tilix, Xfce Terminal, More) LXer Syndicated Linux News 0 07-28-2019 04:50 AM
How to log internal-sftp chroot jailed users access log to /var/log/sftp.log file LittleMaster Linux - Server 0 09-04-2018 03:45 PM
[SOLVED] after installation of MySQL could not log into mysql using temporary password in /var/log/mysqld.log User247 Linux - Server 2 12-25-2017 09:31 AM
[SOLVED] Xfce: I can't log out from Xfce and go back to the login prompt jayhel Slackware - Installation 11 03-31-2014 05:52 AM
Log off/log on as different user breaks X apps under Debian 5.0.1 lbdu Debian 1 06-26-2009 05:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration