Auto Login with Debian ?

Hello all;

I am trying to get my BBB to automatically login as root after it boots.

This is the image I am running:

“Linux beaglebone 3.8.13-bone70 #1 SMP Fri Jan 23 02:15:42 UTC 2015 armv7l GNU/Linux”

After some Google, I found several methods that appear to be out of date.

They all suggest modifying the “/etc/inittab” file as below:

First install rungetty using the following command

#apt-get install rungetty

you need to edit the /etc/inittab file

#nano /etc/inittab

look for the following line

comment out

#1:2345:respawn:/sbin/getty 38400 tty1

and add

1:2345:respawn:/sbin/rungetty tty1 --autologin YOUR_USER_NAME

or

1:2345:respawn:/bin/login -f root tty1 </dev/tty1 >/dev/tty1 2>&1

none of the above work :frowning:

I’m sure this is do able, I just don’t know how to with this image.

Thanks;

Bill

I could REALLY use some help here L

So I found a 10 year old post by Robert Nelson, [RobertCNelson 05/04/2010]where he also suggests either writing your own login.c file or using “rungetty” as well.

However, I am wondering if “systemd” even uses this file?

If not, then what file(s) does systemd use ?

Thanks

Hello all;

I am trying to get my BBB to automatically login as root after it boots.

This is the image I am running:

“Linux beaglebone 3.8.13-bone70 #1 SMP Fri Jan 23 02:15:42 UTC 2015 armv7l GNU/Linux”

After some Google, I found several methods that appear to be out of date.

They all suggest modifying the “/etc/inittab” file as below:

First install rungetty using the following command

#apt-get install rungetty

you need to edit the /etc/inittab file

#nano /etc/inittab

look for the following line

comment out

#1:2345:respawn:/sbin/getty 38400 tty1

and add

1:2345:respawn:/sbin/rungetty tty1 --autologin YOUR_USER_NAME

or

1:2345:respawn:/bin/login -f root tty1 </dev/tty1 >/dev/tty1 2>&1

none of the above work :frowning:

I’m sure this is do able, I just don’t know how to with this image.

Thanks;

Bill

Should get you started

https://wiki.archlinux.org/index.php/Automatic_login_to_virtual_console

Should get you started

Thanks for the help Don.

I followed the link, but it would appear that Arch Linux uses a slightly different file structure.

So I looked around and found what I thought was the correct file and modified it per the Arch Instructions.

Unfortunately it didn’t work after a “shutdown now –r” command.

I am wondering if there is something else I had to do before reboot ?

Here is the file:

root@beaglebone:/etc/systemd/system/getty.target.wants# ls -l

total 0

lrwxrwxrwx 1 root root 34 Oct 9 2013 getty@tty1.service → /lib/systemd/system/getty@.service

lrwxrwxrwx 1 root root 47 Mar 1 2015 serial-getty@ttyGS0.service → /etc/systemd/system/serial-getty@ttyGS0.service

And some people wonder why sites like without.systemd.org exist . . .

Thanks William.

I checked out:

http://without-systemd.org/wiki/index.php/How_to_remove_systemd_from_a_Debian_jessie/sid_installation

and it looks like I would have to change this line in uEnv.txt

uname_r=3.8.13-bone70

#dtb=

cmdline=quiet init=/lib/systemd/systemd ß to something else ?

Is there not some way to just configure systemd to do the same thing ??

Well based on ^ that it's wheezy... just do:

cmdline=quiet init=/lib/systemd/systemd
to:
#cmdline=quiet init=/lib/systemd/systemd

for no more systemd in "wheezy"..

However for "Jessie" or later, it'll take more work. Personally,
systemd has been more useful then painful.. (just enough :slight_smile: )

Regards,

Pretty much you have to instal SYSV, remove systemd and do what Roberts suggests for wheezy. It could fix your issue, if you wanted to do away with systemd. That is probably what I’d do, but that doesn’t mean that anyone else has to agree with me. For me it is a simple matter of being able to get the things done that I want to get done. Without having to explore new ways of doing the old things I already know how to do . . .

Thanks for getting back guys ….

IMHO there has to be a straight forward way of doing this.

By that I mean, I don’t have to login to my microwave to make popcorn.

(there are 1000’s of embedded systems running Linux)

So somebody must have done it ??

Why would root on anyone need to be logged into an embedded system? Mike

I should also mention that this is one reason why I’m still running Wheezy. As Robert has made it pretty simple to apt-get install kernel wise. This means that I miss out on some newer packages perhaps. But currently I have no pressing need for for anything that new. All I need is CAN( check ), can-utils( check - Self compiled ), and a reasonably new version of gcc( check ). All the rest I plan on writing myself.

So for what you’re asking I’ve read that most people do using . . . I think it’s called ssh certificates. Or something similar. No need for a passwd, just configure the ssh server, and the client on the remote side to use this / the certificate. This can be done using sysv, so I do not see why it wouldn’t work using systemd as well. It’s not exactly “auto login”, but it is probably the safest way to do what you suggest.

By the way, Mike has a valid point. . .

William, are you attempting to do this from the physical console, or through ssh ?

So you can forget about using /etc/inittab. This is sysv specific.Unless you revert to sysv.

The way I see it you have two options.

  1. Get ready to spend a good amount of time figuring out systemd.
  2. Get rid of systemd, and go back to sysv, or the Jessie equivalent.

Probably the reason why you’re having a tough time finding information is that probably many “old timers” such as myself may find the concept of systemd pretty cool, but in the real world where things need to get done. We can’t be f’d to spend all the time needed to figure out every single detail that we already know how to do - Using sysv. So you’re going to have to spend some serious time wading through whatever documentation you can find - To do the things you want to do.

I just did a quick google search myself on the subject, and closest I came to an answer in a short amount of time was this . . .

http://unix.stackexchange.com/questions/170555/why-is-my-debian-jessie-always-in-runlevel-5

Not exactly very helpful, but the first answer does point to a systemd FAQ. Which may be a good place for you to start ?

Systemd Essentials: Working with Services, Units, and the Journal
https://www.digitalocean.com/community/tutorials/systemd-essentials-working-with-services-units-and-the-journal

How To Configure a Linux Service to Start Automatically After a Crash or Reboot
https://www.digitalocean.com/community/tutorials/how-to-configure-a-linux-service-to-start-automatically-after-a-crash-or-reboot-part-1-practical-examples

https://www.digitalocean.com/community/tutorials/how-to-configure-a-linux-service-to-start-automatically-after-a-crash-or-reboot-part-2-reference

There are other Systemd tutorials on Digital Ocean, too.

— Graham

Learn systemd and be done with it. Keep following the wiki page I sent you and read all pages it links to… You will get what you want if you keep playing with it. You’re not far from success

Thanks Don, looks lie systemd is a step forward while the other is a step backward ….

Learn systemd and be done with it. Keep following the wiki page I sent you and read all pages it links to…

You will get what you want if you keep playing with it. You’re not far from success

Ok Guys;

So I went with the systemd approach an followed the auto login link someone suggested.

Unfortunately, none of the methods worked L

Arch Linux

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

or

Jessie

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

[Service]

ExecStart=

ExecStart=-/sbin/agetty --autologin root -–noclear %I 38400 linux

or

Install rungetty

ExecStart=-/sbin/rungetty --autologin root -–noclear %I 38400 linux

/etc/inittab

Search for the line:

1:2345:respawn:/sbin/getty 38400 tty1

Replace with as follow

1:2345:respawn:/sbin/rungetty --autologin --noclear tty1

After modifying the inittab restart the system.