Difference between revisions of "Automatic login to virtual console"

From ArchWiki
Jump to: navigation, search
m (Avoid unnecessary dmesg errors)
(all information available in getty via https://wiki.archlinux.org/index.php?title=Getty&diff=440522&oldid=440520)
 
(52 intermediate revisions by 29 users not shown)
Line 1: Line 1:
[[Category:Boot process]]
+
#REDIRECT: [[Getty#Automatic_login_to_virtual_console]]
[[Category:Security]]
+
[[es:Automatic login to virtual console]]
+
[[it:Automatic login to virtual console]]
+
{{Article summary start}}
+
{{Article summary text|Describes how to automatically log in to a virtual console.}}
+
{{Article summary heading|Related}}
+
{{Article summary wiki|Display Manager}}
+
{{Article summary wiki|Silent boot}}
+
{{Article summary wiki|Start X at Login}}
+
{{Article summary end}}
+
 
+
This article describes how to automatically log in to a ''virtual console'' at the end of the [[boot process]]. This article only covers console log-ins; methods for starting an [[Xorg|X server]] are described in [[Start X at Login]].
+
 
+
== Installation ==
+
=== Creating the {{ic|.service}} ===
+
Create a new service file similar to {{ic|getty@.service}} by copying it to {{ic|/etc/systemd/system/}}:
+
 
+
# cp /usr/lib/systemd/system/getty@.service /etc/systemd/system/autologin@.service
+
 
+
{{Note|{{ic|/etc/systemd/system/}} takes precedence over {{ic|/usr/lib/systemd/system/}}.}}
+
 
+
Then change the {{ic|ExecStart}} line to include the {{ic|-a ''USERNAME''}} parameter:
+
 
+
{{hc|/etc/systemd/system/autologin@.service|
+
2=[Service]
+
''[...]''
+
ExecStart=-/sbin/agetty --noclear -a ''USERNAME'' %I 38400
+
''[...]''
+
 
+
[Install]
+
WantedBy=getty.target
+
}}
+
 
+
{{Tip|The option {{ic|1=Type=simple}} (default) will delay the execution of agetty until all jobs (state change requests to units) are completed. On the other hand it may cause systemd boot-up messages to pollute the login prompt. This option is more useful when [[Start X at Login|starting X automatically]]. See {{ic|man systemd.service}} for more info.}}
+
 
+
=== Enabling the {{ic|.service}} ===
+
Finally, you need to disable the old {{ic|getty@tty''X''.service}} for the specified tty and enable the new {{ic|autologin@tty''X''.service}}, e.g.:
+
# systemctl daemon-reload
+
# systemctl disable getty@''tty1''
+
# systemctl enable autologin@''tty1''
+
 
+
To test it out, use:
+
# systemctl start autologin@''tty1''
+
 
+
{{Warning|If you are currently in an X session on the same tty configured in the service file, starting {{ic|autologin@tty''X''.service}} will kill your X server.}}
+
 
+
== Tips & Tricks ==
+
 
+
=== Avoiding unnecessary dmesg errors ===
+
To avoid errors related to {{ic|display-manager.service}} in dmesg, you should set the default target to multi-user instead of graphical:
+
# systemctl enable multi-user.target
+
 
+
==See also==
+
* [[Systemd#Change_default_target_to_boot_into|Change default runlevel/target to boot into]].
+

Latest revision as of 12:48, 17 August 2016