You are not logged in.

#1 2015-07-29 17:58:08

S3NTYN3L
Member
From: Blito-P3
Registered: 2015-07-29
Posts: 43

[SOLVED] Agetty/login asking for username twice?

Hello all,
I've been trying for hours (two days really) to fix this issue but I'm at my wits end.
I'm trying to make agetty and login as quiet as possible by removing all prelogin output except for.

login:

Building on the autologin wiki page and a clue from post #7 here

I have the following in

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

[Service]
ExecStart=
ExecStart=-/usr/bin/agetty --nohostname --nohints --noissue --login-options "-H" --noclear %I $TERM

Now, this works, HOWEVER, at the first prompt, (I'm assuming from agetty), I'm required to input my username twice. (pressing ENTER after inputting my username the first time yields a second username prompt).
As defined in /etc/login.defs I can attempt login 5 times.

login: s3ntyn3l
login: s3ntyn3l
password: input-wrong-pw
Login incorrect

login:

If I provide incorrect info the first time, the remaining four attempts work as intended. (IE; asking for a username and password only once each). I suppose I should also note that using the correct information at the first prompt will log me in as well, it's just that I need to type username twice.

Once those attempts are exhausted and the timeout resets, I'm greeted with the first prompt again. And again it wants my username twice.
I was under the impression that agetty only spawned once, on boot, and then login took over, but whatever. hmm undecided.gif hmm


I've tried passing all combinations, that I can think of at least, of the option switches (from the "man login" page) -p -h -H being the relevant ones in my mind.
I've tried using --login-options with quotes and without.
I've even tried combinations of

--login-options "/bin/login -switch"

The closest I've come is what you see above.
If a change I've tried didn't outright break the login, (forcing me to chroot into the system to try again), it wouldnt work as intended and would onlymake the first login attempt quiet while showing my hostname for the others.



OK, sorry for babbling, any help is greatly appreciated in getting this login working as i intend.
Thanks in advance!

Last edited by S3NTYN3L (2015-07-30 15:06:55)

Offline

#2 2015-07-29 18:05:05

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: [SOLVED] Agetty/login asking for username twice?

Make sure you don't have multiple @tty1 links in /etc/systemd/system/getty.target.wants/ . I once enabled autologin@tty1 and neglected to disable getty@tty1; IIRC something similar happened.


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#3 2015-07-29 19:09:17

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: [SOLVED] Agetty/login asking for username twice?

Have you tried:

ExecStart=-/usr/bin/agetty --nohostname --nohints --noissue --login-options -a \u --noclear %I $TERM # you could also try "--login-options -a <user name>"

Offline

#4 2015-07-29 20:17:52

S3NTYN3L
Member
From: Blito-P3
Registered: 2015-07-29
Posts: 43

Re: [SOLVED] Agetty/login asking for username twice?

@alphaniner
Nope, nothing in there but the default getty@tty1.service file.

@Head_on_a_Stick
That broke agetty/login. Sadly, it dropped me off at a blinking cursor that I could do nothing with.

The thing is, I KNOW I had this working a few weeks ago on a previous install.
I KNOW I'm editing the same/only file as before, it's just that none of the syntax I try seems to be working. sad


EDIT:

I figured it out!
I feel so dumb right about now, lol!
I don't recall having to use this method a few weeks ago, but whatever...

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

[Service]
ExecStart=
ExecStart=-/usr/bin/agetty --login-options -H --skip-login %I $TERM

note the addition of:

--skip-login

and the removal of:

--noclear --nohints --nohostname --noissue

from the line since;
1) --noclear  is used by agetty by default on arch
2) the use of --skip-login, by definition, skips agetty's login prompt making the remaining switches irrelevant.


I'll mark this as solved now and hopefully someone else will find it useful. wink

Last edited by S3NTYN3L (2015-07-30 15:17:01)

Offline

Board footer

Powered by FluxBB