You are not logged in.

#26 2020-07-22 09:15:39

Naik
Member
From: Lipsia
Registered: 2015-10-03
Posts: 280

Re: Autologin and startx without a display manager.

^ For me the subject is just for fun. I don't think lightdm is that hungry on ressources, but since it is only used for showing lock-in greeter whenever my (single user, single DE/WM -)system went to sleep, I thought of getting rid off it...

naik --greetz


"Kaum macht [Mensch]* es richtig, funktioniert es sofort!"
BL-Kitchen on GitHub

Offline

#27 2020-07-22 09:16:27

ohnonot
...again
Registered: 2015-09-29
Posts: 5,306
Website

Re: Autologin and startx without a display manager.

Naik, I have been running without a display manager for ages, albeit on ArchLinux.
It is definitely possible,on Debian too.
As general recommendation, read this: https://wiki.archlinux.org/index.php/Xinit#xinitrc, esp. this:

Note: At the very least, ensure that the last if block in /etc/X11/xinit/xinitrc is present in your ~/.xinitrc file to ensure that the scripts in /etc/X11/xinit/xinitrc.d are sourced.

Also be aware that Debian might be doing things slightly different.

And also this: https://wiki.debian.org/xinit https://wiki.debian.org/Xinitrc

If you still get the delay on shutdown we have to troubleshoot more.


Please use CODE tags for code.
Search youtube without a browser: repo | thread
BL quote proposals to this thread please.
my repos / my repos

Offline

#28 2020-07-22 10:10:48

rbh
Member
From: Sweden/Vasterbotten/Rusfors
Registered: 2016-08-11
Posts: 926

Re: Autologin and startx without a display manager.

Naik wrote:

^ For me the subject is just for fun. I don't think lightdm is that hungry on ressources, but since it is only used for showing lock-in greeter whenever my (single user, single DE/WM -)system went to sleep, I thought of getting rid off it...

Ok, if it is only lightdm ou get rid of, it is only 5.7 MiB, you cut of.

Thanks, my aroused curiosity stilled...


// Regards rbh

Offline

#29 2020-07-23 07:35:43

Naik
Member
From: Lipsia
Registered: 2015-10-03
Posts: 280

Re: Autologin and startx without a display manager.

@Ohnonot: I thought it has been recommended not to use a ~./xinitrc file on debian because it would negotiate the effort the developers put into creating a bunsenlabs-session.

reading the logs I only found this:

Jul 22 21:40:04 GerryTSSD systemd[1]: Stopped Login Service.
Jul 22 21:41:34 GerryTSSD systemd[3243]: ^[[0;1;39m^[[0;1;39mat-spi-dbus-bus.service: State 'stop-sigterm' timed out. Killing.
Jul 22 21:41:34 GerryTSSD systemd[3243]: ^[[0;1;39m^[[0;1;39mat-spi-dbus-bus.service: Killing process 3362 (at-spi-bus-laun) with signal SIGKILL.
Jul 22 21:41:34 GerryTSSD systemd[3243]: ^[[0;1;39m^[[0;1;39mat-spi-dbus-bus.service: Main process exited, code=killed, status=9/KILL
Jul 22 21:41:34 GerryTSSD systemd[3243]: ^[[0;1;39m^[[0;1;39mat-spi-dbus-bus.service: Failed with result 'timeout'.

But maybe one of you guys can find more relevant info in the journal of a typical short session.

Thanks!


"Kaum macht [Mensch]* es richtig, funktioniert es sofort!"
BL-Kitchen on GitHub

Offline

#30 2020-07-23 15:48:27

ohnonot
...again
Registered: 2015-09-29
Posts: 5,306
Website

Re: Autologin and startx without a display manager.

Naik wrote:

@Ohnonot: I thought it has been recommended not to use a ~./xinitrc file on debian because it would negotiate the effort the developers put into creating a bunsenlabs-session.

I'm pretty sure the bit from the archwiki I pointed out is still important because that's something the display manager would do normally.


Please use CODE tags for code.
Search youtube without a browser: repo | thread
BL quote proposals to this thread please.
my repos / my repos

Offline

#31 2020-07-24 08:03:45

Naik
Member
From: Lipsia
Registered: 2015-10-03
Posts: 280

Re: Autologin and startx without a display manager.

ohnonot wrote:

I'm pretty sure the bit from the archwiki I pointed out is still important because that's something the display manager would do normally.

Yes, you sure are right. The problem is, all of this, and everything I could find elsewhere for now is about the start of an x-session and how to do the stuff the display-manager would do for me. But my problem occurs when I end the x-session and anyhow are not properly logged out.

Archwiki wrote:

Prepending exec will replace the script process with the window manager process, so that X does not exit even if this process forks to the background.

Now I have used "exec" to the startx command in ~/.bash_profile, thinking the x-session invoked should replace the terminal session it was called in (for obscure concerns on security mainly). May this be the reason for my trouble?
I'll do some try&error testing later today!

Thanks for your help so far!

naik --greetz

Last edited by Naik (2020-07-24 08:04:32)


"Kaum macht [Mensch]* es richtig, funktioniert es sofort!"
BL-Kitchen on GitHub

Offline

#32 2020-07-25 09:38:26

Naik
Member
From: Lipsia
Registered: 2015-10-03
Posts: 280

Re: Autologin and startx without a display manager.

^ Investigating further I found that:
A: removing exec did not help, but  broke the whole thing so x didn't start at all and
B: I'm unable to logout out now without automatically being logged in again.

Could it be that reboot and shutdown get delayed because systemd is constantly trying to log me in again? Where would be a place to look for evidence?

Thanks.

Naik --greetz


"Kaum macht [Mensch]* es richtig, funktioniert es sofort!"
BL-Kitchen on GitHub

Offline

#33 2020-07-25 10:54:30

ohnonot
...again
Registered: 2015-09-29
Posts: 5,306
Website

Re: Autologin and startx without a display manager.

Naik wrote:

A: removing exec did not help, but  broke the whole thing so x didn't start at all and

This is strange. My startx/~/.xinitrc combo is not that fragile. It behaves differently - 'exec startx' ends the shell when executing startx, hence I'm effectively logged out when I end the session.

Naik wrote:

B: I'm unable to logout out now without automatically being logged in again.

This is the result of configuring the getty systemd target to autologin as outlined in post #1.

Naik wrote:

Could it be that reboot and shutdown get delayed because systemd is constantly trying to log me in again? Where would be a place to look for evidence?

journalctl

has various options and defaults depending on what you're looking for.


Please use CODE tags for code.
Search youtube without a browser: repo | thread
BL quote proposals to this thread please.
my repos / my repos

Offline

#34 2021-02-19 14:41:32

lumos
New Member
Registered: 2021-02-19
Posts: 3

Re: Autologin and startx without a display manager.

Hi all,

thank you for this tutorial.
I have implemented it but I notice a problem if I SSH into the computer with the autologin username ex:

ssh username@192.168.1.100

SSH start the login and ask me for the password but, after hit return, it ask me immediately for the sudo password.

How can I prevent this?

Thanks

Offline

#35 2021-02-20 03:29:42

ohnonot
...again
Registered: 2015-09-29
Posts: 5,306
Website

Re: Autologin and startx without a display manager.

^ The topic of this thread has nothing to do with ssh, which is generally used to log into remote machines, i.e. servers of some kind.
I don't quite understand what you're doing there; are 2 machines involved?
I any case:

  • sshd must be running on the machine your ssh'ing into

  • even sudo doesn't ask for "the sudo password"

Show us the complete command and the complete output it produced.


Please use CODE tags for code.
Search youtube without a browser: repo | thread
BL quote proposals to this thread please.
my repos / my repos

Offline

#36 2021-02-20 07:35:46

lumos
New Member
Registered: 2021-02-19
Posts: 3

Re: Autologin and startx without a display manager.

ohnonot wrote:

^ The topic of this thread has nothing to do with ssh, which is generally used to log into remote machines, i.e. servers of some kind.
I don't quite understand what you're doing there; are 2 machines involved?
I any case:

  • sshd must be running on the machine your ssh'ing into

  • even sudo doesn't ask for "the sudo password"

Show us the complete command and the complete output it produced.

Thank you for your answer,

I have a machine that autologin and start x as explained in this topic.
I access to this machine also from remote to make periodic maintenance.
Before adding the "autologin" to this file:

/etc/systemd/system/getty@tty1.service.d/override.conf

as explained at the start of the topic, there are no problems during the ssh log in.
I just type ssh username@xxx.xxx.xxx.xxx from the remote machine, input the password and I'm at bash shell.
After the autologin modify, when I type ssh username@xxx.xxx.xxx.xxx, I'm able to login but immediately after hit enter, the bash ask me for the sudo password.
If I type the sudo password the shell return me the follow message:

ssh username@192.168.1.100
username@192.168.1.100's password:
Linux test 4.19.0-14-amd64 #1 SMP Debian 4.19.171-2 (2021-01-30) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Fri Feb 19 09:07:33 2021
[sudo] password for username:
Can't open display
username@test:~$

If I try to login with other users, the login happen without problems.
This message come only with the autologin feature explained in this topic.

Obviously the user "username" is a sample, mine is different.

Thanks

Last edited by lumos (2021-02-20 07:36:43)

Offline

#37 2021-02-20 13:18:56

ohnonot
...again
Registered: 2015-09-29
Posts: 5,306
Website

Re: Autologin and startx without a display manager.

lumos wrote:

I have a machine that autologin and start x as explained in this topic.

Is that machine working normally otherwise? Autologin and all?

I'd say it's a feature, not a bug, but then I'm very confused about "Can't open display"... a normal ssh command should not do that.

Are all your users called just username? That certainly adds to the confusion.

Maybe also show us the contents of all the files you edited to get autologin to work.


Please use CODE tags for code.
Search youtube without a browser: repo | thread
BL quote proposals to this thread please.
my repos / my repos

Offline

#38 2021-02-20 13:59:38

lumos
New Member
Registered: 2021-02-19
Posts: 3

Re: Autologin and startx without a display manager.

ohnonot wrote:
lumos wrote:

I have a machine that autologin and start x as explained in this topic.

Is that machine working normally otherwise? Autologin and all?

I'd say it's a feature, not a bug, but then I'm very confused about "Can't open display"... a normal ssh command should not do that.

Are all your users called just username? That certainly adds to the confusion.

Maybe also show us the contents of all the files you edited to get autologin to work.

1. Yes, the machine work properly on all other features.

2. No “username” is a sample for this post. All other users access without problems and without this sudo password request and display message.

3. The files are exactly the same of this topic, no more no less. I have also tried to create a new user and apply what explained in this topic. Same sudo password request and same display message.
If I remove the modifies to the original “username”, the sudo password and display message disappear.
I think this is correlated to the auto login script.

Last edited by lumos (2021-02-20 14:00:32)

Offline

#39 2021-02-20 18:12:26

ohnonot
...again
Registered: 2015-09-29
Posts: 5,306
Website

Re: Autologin and startx without a display manager.

I think you better start a dedicated thread with a full problem description.


Please use CODE tags for code.
Search youtube without a browser: repo | thread
BL quote proposals to this thread please.
my repos / my repos

Offline

#40 2021-02-20 21:08:39

tknomanzr
BL Die Hard
From: Around the Bend
Registered: 2015-09-29
Posts: 1,049

Re: Autologin and startx without a display manager.

I use a static IP on boxes I ssh into so that can map a hostname in /etc/hosts to my IP and use that hostname to login. You shouldn't be seeing a root login console unless you are using sudo or su with the ssh command.

Offline

Board footer

Powered by FluxBB