Skip to main content Trying to auto login on a Debian 11 machine that has no gui. : r/debian

Trying to auto login on a Debian 11 machine that has no gui.

I had install Debian 11 on a special slice, without any graphics.

I would like to get it logged in automatically as root, then launch a shell script (.sh).

As far as i understand, most setting files uses to be at /etc/somefile.conf, is it enought to just locate the correct one and edit it with Nano?

Worried about costs? Switching from MagicINFO to Samsung VXT was smooth and secure — and it cut expenses while keeping things efficient.
Thumbnail image: Worried about costs? Switching from MagicINFO to Samsung VXT was smooth and secure — and it cut expenses while keeping things efficient.
Sort by:
Best
Open comment sort options
Edited

Automating a root login probably isn't the best idea I've heard this week - there are a couple of ways to run a script as root without having root log on to the machine. This is easily done with the system crontab or a systemd unit that runs on boot.

If you really need a root login this is done with a systemd override. See https://wiki.archlinux.org/title/getty#Automatic_login_to_virtual_console

Hope this helps -

Thanks, i'm going to try it.

More replies

maybe you need:

rungetty - minimal console getty that can run any process

apt-cache search autologin found this one, there may be others as well

[deleted]

https://superuser.com/questions/969923/automatic-root-login-in-debian-8-0-console-only

Look at the first solution, it should also work for Debian 11

What do you mean by 'has no gui'? are you trying to autologin to a tty? or you mean that there's no display manager (gdm, sddm, lightdm...) and you are trying to login to a desktop environment (kde, xfce, gnome...) ?

Because the ways to achieve this will vary based on your situation.