You are not logged in.

#1 2012-11-17 02:33:25

mytbk
Member
Registered: 2012-05-27
Posts: 26

How to login automatedly?

I saw the archlinux livecd can login as root automatedly, so I wonder how to make it happen.

Offline

#2 2012-11-17 02:41:11

chris_l
Member
Registered: 2010-12-01
Posts: 390

Re: How to login automatedly?

root has no password assigned.
Edit: oh yeah and it has that autologin@.service on /etc/systemd/system

Last edited by chris_l (2012-11-17 02:49:21)


"open source is about choice"
No.
Open source is about opening the source code complying with this conditions, period. The ability to choose among several packages is just a nice side effect.

Offline

#3 2012-11-17 03:09:00

mhertz
Member
From: Denmark
Registered: 2010-06-19
Posts: 681

Re: How to login automatedly?

Offline

#4 2012-11-17 11:21:47

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: How to login automatedly?

I tired it once and it didn't really work for me. I was being logged in automatically, but 'Login' and 'Password' kept respawning and destroyed tty1.
Is it working for you?

I'll try again (some edits were made yesterday) and open a separate thread if the wiki missed something.

Last edited by karol (2012-11-17 11:23:04)

Offline

#5 2012-11-17 18:15:51

mhertz
Member
From: Denmark
Registered: 2010-06-19
Posts: 681

Re: How to login automatedly?

Yep, works fine here...

Offline

#6 2012-11-17 19:10:00

Antoine
Member
From: Picton Ontario
Registered: 2012-10-11
Posts: 90

Re: How to login automatedly?

karol wrote:

I'll try again (some edits were made yesterday) and open a separate thread if the wiki missed something.

The wiki hasn't missed anything.  This is my /etc/systemd/system/autologin\@.service:

[Unit]
Description=Getty on %I
Documentation=man:agetty(8)
After=systemd-user-sessions.service plymouth-quit-wait.service
After=rc-local.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
IgnoreOnIsolate=yes

# On systems without virtual consoles, don't start any getty. (Note
# that serial gettys are covered by serial-getty@.service, not this
# unit
ConditionPathExists=/dev/tty0
StopWhenUnneeded=true
[Service]
Environment=TERM=linux
# the VT is cleared by TTYVTDisallocate
ExecStart=-/sbin/agetty -8 -a antoine --noclear %I 38400
Type=idle
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]
# Edit
WantedBy=getty.target
#Alias=getty.target.wants/getty@tty1.service
# this changed since I first set it up -- it still worked though ...

And it does a bang-up job! Did you do this:

# systemctl daemon-reload
# systemctl disable getty@tty1
# systemctl enable autologin@tty1
# systemctl start autologin@tty1

The one about disabling getty@tty1 is probalby reasonably important.

Last edited by Antoine (2012-11-17 23:55:31)

Offline

#7 2012-11-17 22:25:42

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: How to login automatedly?

Antoine, please fix the quote, it should say 'karol wrote' :-)

Offline

#8 2012-11-17 22:41:18

Earnestly
Member
Registered: 2011-08-18
Posts: 805

Re: How to login automatedly?

Antonie,

Please update your code to reflect the changes to getty.target as outlined in the Automatic Login to Virtual Console wiki article, thanks big_smile

Offline

#9 2012-11-17 23:48:52

Antoine
Member
From: Picton Ontario
Registered: 2012-10-11
Posts: 90

Re: How to login automatedly?

karol wrote:

Antoine, please fix the quote, it should say 'karol wrote' :-)

Done. Sorry.

Offline

#10 2012-11-17 23:55:54

Antoine
Member
From: Picton Ontario
Registered: 2012-10-11
Posts: 90

Re: How to login automatedly?

karol wrote:

Antoine, please fix the quote, it should say 'karol wrote' :-)

Done. It's hard to keep up ...

Dunno how this one happened. How do we delete a post?

Last edited by Antoine (2012-11-17 23:57:10)

Offline

#11 2012-11-17 23:57:39

Antoine
Member
From: Picton Ontario
Registered: 2012-10-11
Posts: 90

Re: How to login automatedly?

Kaustic wrote:

Antonie,

Please update your code to reflect the changes to getty.target as outlined in the Automatic Login to Virtual Console wiki article, thanks big_smile

Done. It's hard to keep up.

Offline

#12 2012-11-18 12:30:35

Earnestly
Member
Registered: 2011-08-18
Posts: 805

Re: How to login automatedly?

Just to note; you don't need to escape '@' on the command line like you have above. Someone added that to the wiki for awhile before it was corrected. hmm

Upstream changes to the getty.target mean you can properly use the template that '@' represents. Essentially you achieve the same goal but getty.target provides more flexibility as you can now enable autologin@ on any tty instead of just tty1 without manually editing the service. E.g.

systemctl enable autologin@tty5

Would create an appropriate autologin@tty5.service symlink under /etc/systemd/system/getty.target.wants big_smile

PS: I wish we could use rst for forum posts instead of bbcode sad

Last edited by Earnestly (2012-11-18 12:45:11)

Offline

#13 2012-11-20 20:52:37

Dtag
Member
Registered: 2012-11-20
Posts: 3

Re: How to login automatedly?

Is there a way to make agetty only ask for a password, and not for a username?

Offline

Board footer

Powered by FluxBB