You are not logged in.

#1 2014-10-01 11:16:49

Lockheed
Member
Registered: 2010-03-16
Posts: 1,521

[solved] How to revert Automatic login to virtual console?

Long, long time ago (maybe 3 years back), I set up automatic login for my user. Now, I am trying to revert it so that the console asks me for username (unless it is avoidable) and password upon login.

So I though "Easy! I'll just go here https://wiki.archlinux.org/index.php/au … al_console and delete the file mentioned there:

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

But the file is not present on my system. Instead, I have this:
/etc/systemd/system/getty.target.wants/getty\@tty1.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 Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

[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

[Service]
Environment=TERM=linux
# the VT is cleared by TTYVTDisallocate
ExecStart=-/sbin/agetty --noclear -a smith %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]
Alias=getty.target.wants/getty@tty1.service

... but if I remove it, or even just uncomment the lines in the [Service] section, upon boot the console output stops at the last SystemD init message, and never gets to user/password prompt. I need to switch to other ttys to access it.

Last edited by Lockheed (2014-10-22 12:43:57)

Offline

#2 2014-10-01 11:55:55

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: [solved] How to revert Automatic login to virtual console?

Perhaps "grep autologin -R /etc /usr/lib" would point you to something.

-edit-

Maybe grep for "getty", as apparently "-a" is equivalent to "--autologin".

-edit-

Okay. Remove "-a" in the file you pasted.

-edit-

You could also remove the symlink and the file it points to and create there a symlink to the file coming with systemd, as your file differs somewhat from what I have.

ls -l /etc/systemd/system/getty.target.wants/getty@tty1.service
lrwxrwxrwx 1 root root 38 Jun 21  2012 /etc/systemd/system/getty.target.wants/getty@tty1.service -> /usr/lib/systemd/system/getty@.service

Last edited by lucke (2014-10-01 12:12:35)

Offline

#3 2014-10-22 08:25:37

Lockheed
Member
Registered: 2010-03-16
Posts: 1,521

Re: [solved] How to revert Automatic login to virtual console?

So I tried doing that all, but the result is still the same - console no longer logs in, but it gets stuck on the last init line without prompt for user account/password.

Offline

#4 2014-10-22 10:44:20

bstaletic
Member
Registered: 2014-02-02
Posts: 658

Re: [solved] How to revert Automatic login to virtual console?

Remove "-a smith" from the service section and try again.

Offline

Board footer

Powered by FluxBB