Auto Login with Debian ?

851 views
Skip to first unread message

Bill Pretty

unread,
Sep 4, 2015, 10:34:53 PM9/4/15
to beagl...@googlegroups.com

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

 

 

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

 

Thanks;

 

Bill

Bill Pretty

unread,
Sep 5, 2015, 9:09:47 PM9/5/15
to beagl...@googlegroups.com

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

 

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Don deJuan

unread,
Sep 6, 2015, 1:52:22 AM9/6/15
to beagl...@googlegroups.com

Bill Pretty

unread,
Sep 6, 2015, 1:13:10 PM9/6/15
to beagl...@googlegroups.com

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 ge...@tty1.service -> /lib/systemd/system/getty@.service

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

 

===========================

 

nano /lib/systemd/system/getty@.service

 

 

#  This file is part of systemd.

#

#  systemd is free software; you can redistribute it and/or modify it

#  under the terms of the GNU General Public License as published by

#  the Free Software Foundation; either version 2 of the License, or

#  (at your option) any later version.

 

[Unit]

Description=Getty on %I

BindTo=dev-%i.device

After=dev-%i.device systemd-user-sessions.service plymouth-quit-wait.service

 

# If additional gettys are spawned during boot then we should make

# sure that this is synchronized before getty.target, even though

# getty.target didn't actually pull it in.

Before=getty.target

 

[Service]

Environment=TERM=linux

#ExecStart=-/sbin/agetty %I 38400

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

Restart=always

RestartSec=0

UtmpIdentifier=%I

TTYPath=/dev/%I

TTYReset=yes

TTYVHangup=yes

TTYVTDisallocate=yes

KillMode=process

IgnoreSIGPIPE=no

 

# Unset locale for the console getty since the console has problems

# displaying some internationalized messages.

Environment=LANG= LANGUAGE= LC_CTYPE= LC_NUMERIC= LC_TIME= LC_COLLATE= LC_MONETARY= LC_MESSAGES= LC_PAPER= LC_NAME= LC_ADDRESS= LC_TELEPHONE= LC_MEASUREMENT= LC_IDENTIFICATION=

 

# Some login implementations ignore SIGTERM, so we send SIGHUP

# instead, to ensure that login terminates cleanly.

KillSignal=SIGHUP

 

[Install]

Alias=getty.target.wants/ge...@tty1.service

 

 

 

 



William Hermans

unread,
Sep 6, 2015, 3:14:01 PM9/6/15
to beagl...@googlegroups.com
And some people  wonder why sites like without.systemd.org exist . . .

Bill Pretty

unread,
Sep 6, 2015, 10:12:53 PM9/6/15
to beagl...@googlegroups.com

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 ??

Robert Nelson

unread,
Sep 6, 2015, 11:45:21 PM9/6/15
to Beagle Board
On Sun, Sep 6, 2015 at 9:10 PM, Bill Pretty <bill....@xplornet.com> wrote:
> 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 ?

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 :) )

Regards,

--
Robert Nelson
https://rcn-ee.com/

William Hermans

unread,
Sep 7, 2015, 12:03:49 AM9/7/15
to beagl...@googlegroups.com
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 . . .

Bill Pretty

unread,
Sep 7, 2015, 12:12:36 AM9/7/15
to beagl...@googlegroups.com

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 ??

 

From: beagl...@googlegroups.com [mailto:beagl...@googlegroups.com] On Behalf Of William Hermans
Sent: Monday, September 07, 2015 12:04 AM
To: beagl...@googlegroups.com
Subject: Re: [beagleboard] Auto Login with Debian ?

 

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 . . .

Mike

unread,
Sep 7, 2015, 12:20:39 AM9/7/15
to beagl...@googlegroups.com
On 09/07/2015 12:10 AM, Bill Pretty wrote:

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

William Hermans

unread,
Sep 7, 2015, 12:48:11 AM9/7/15
to beagl...@googlegroups.com
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 <whatever> 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 Hermans

unread,
Sep 7, 2015, 1:12:40 AM9/7/15
to beagl...@googlegroups.com
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 ?




Graham

unread,
Sep 7, 2015, 10:55:14 AM9/7/15
to BeagleBoard

Don deJuan

unread,
Sep 7, 2015, 11:04:46 AM9/7/15
to beagl...@googlegroups.com
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
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

Bill Pretty

unread,
Sep 7, 2015, 11:50:53 AM9/7/15
to beagl...@googlegroups.com

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

Bill Pretty

unread,
Sep 7, 2015, 10:24:43 PM9/7/15
to beagl...@googlegroups.com

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/ge...@tty1.service.d/override.conf

 

or

 

Jessie

/etc/systemd/system/ge...@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 <user-name>  --noclear tty1

 

After modifying the inittab restart the system.

 

 

 

 

From: beagl...@googlegroups.com [mailto:beagl...@googlegroups.com] On Behalf Of Don deJuan
Sent: Monday, September 07, 2015 11:04 AM
To: beagl...@googlegroups.com
Subject: Re: [beagleboard] Auto Login with Debian ?

 

On 09/07/2015 07:55 AM, Graham wrote:

Reply all
Reply to author
Forward
0 new messages