Difference between revisions of "Automatic login to virtual console"

From ArchWiki
Jump to: navigation, search
m (Serial console: fix path due to /usr/bin/ merge)
(Undo revision 297335 by Jstjohn (talk) - assignment of an empty string to ExecStart removes any previous assignment)
Line 24: Line 24:
 
{{hc|/etc/systemd/system/getty@tty1.service.d/autologin.conf|2=
 
{{hc|/etc/systemd/system/getty@tty1.service.d/autologin.conf|2=
 
[Service]
 
[Service]
 +
ExecStart=
 
ExecStart=-/usr/bin/agetty --autologin ''username'' --noclear %I 38400 linux
 
ExecStart=-/usr/bin/agetty --autologin ''username'' --noclear %I 38400 linux
 
}}
 
}}
Line 37: Line 38:
 
{{hc|/etc/systemd/system/serial-getty@ttyS0.service.d/autologin.conf|2=
 
{{hc|/etc/systemd/system/serial-getty@ttyS0.service.d/autologin.conf|2=
 
[Service]
 
[Service]
 +
ExecStart=
 
ExecStart=-/usr/bin/agetty --autologin ''username'' -s %I 115200,38400,9600 vt102
 
ExecStart=-/usr/bin/agetty --autologin ''username'' -s %I 115200,38400,9600 vt102
 
}}
 
}}

Revision as of 23:12, 13 February 2014

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; see Start X at Login for information about automatic login into Xorg.

Configuration

Configuration relies on systemd drop-in files to override the default parameters passed to agetty.

Configuration differs for virtual versus serial consoles. In most cases, you want to set up automatic login on a virtual console, (whose device name is ttyN, where N is a number). The configuration of automatic login for serial consoles will be slightly different. Device names of the serial consoles look like ttySN, where N is a number.

Virtual console

Create the following file (and leading directories):

/etc/systemd/system/getty@tty1.service.d/autologin.conf
[Service]
ExecStart=
ExecStart=-/usr/bin/agetty --autologin username --noclear %I 38400 linux
Tip: The option Type=idle will delay the service startup until all jobs (state change requests to units) are completed. When using Type=simple, the service will be started immediately, but boot-up messages may pollute the login prompt. This option is particularly useful when starting X automatically. To use this option, add Type=simple into autologin.conf.

If you want to use a tty other than tty1, see systemd FAQ.

Serial console

Create the following file (and the leading directories):

/etc/systemd/system/serial-getty@ttyS0.service.d/autologin.conf
[Service]
ExecStart=
ExecStart=-/usr/bin/agetty --autologin username -s %I 115200,38400,9600 vt102

See also