Difference between revisions of "Getty"

From ArchWiki
Jump to: navigation, search
(Others: rm red links)
(agetty)
 
(22 intermediate revisions by 8 users not shown)
Line 1: Line 1:
 +
{{Lowercase title}}
 
[[Category:Boot process]]
 
[[Category:Boot process]]
 +
[[ja:Getty]]
 
[[zh-CN:Getty]]
 
[[zh-CN:Getty]]
{{Lowercase title}}
+
{{Related articles start}}
 +
{{Related|Display manager}}
 +
{{Related|Disable clearing of boot messages}}
 +
{{Related|Automatic login to virtual console}}
 +
{{Related articles end}}
 +
{{Expansion}}
  
A getty is the generic name for a program which manages a terminal line and its connected terminal.  Its purpose is to protect the system from unauthorized access.  Generally, each getty process is started by [[init]] and manages a single terminal line.  Within the context of a typical Arch Linux installation, the terminals managed by the getty processes are implemented as virtual consoles.  Six of these virtual consoles are provided by default and they are usually accessible by pressing {{keypress|Ctrl+Alt+F1}} through {{keypress|Ctrl+Alt+F6}}.
+
A [[w:getty (Unix)|getty]] is the generic name for a program which manages a terminal line and its connected terminal.  Its purpose is to protect the system from unauthorized access.  Generally, each getty process is started by [[systemd]] and manages a single terminal line.  
  
 
== agetty ==
 
== agetty ==
  
The {{ic|agetty}} program is the default getty in Arch Linux and is part of the {{Pkg|util-linux}} package which is included in the base Arch Linux installation. It modifies the TTY settings while waiting for a login so that newlines are not translated to CR–LFs. This tends to cause a "staircase effect" for messages printed to the console (printed by programs started by [[Init]] for instance).
+
{{App|[[agetty]]|Agetty is the default getty in Arch Linux. It modifies the TTY settings while waiting for a login so that the newlines are not translated to CR-LFs. This tends to cause a "staircase effect" for messages printed to the console. Agetty manages virtual consoles and six of these virtual consoles are provided by default in Arch Linux. They are usually accessible by pressing {{ic|Ctrl+Alt+F1}} through {{ic|Ctrl+Alt+F6}}.|https://www.kernel.org/pub/linux/utils/util-linux/|{{Pkg|util-linux}}}}
  
== fgetty ==
+
=== Add additional virtual consoles ===
  
The {{AUR|fgetty}} unofficial package is available in the [[Arch User Repository]] and is derived from mingetty.  It does not cause the "staircase effect". The patched {{AUR|fgetty-pam}} is currently required for [[Wikipedia:Pluggable authentication module|Pluggable Authentication Module]] (including SHA-2) support.
+
Open the file {{ic|/etc/systemd/logind.conf}} and set the option '''NAutoVTs=6''' to the number of virtual terminals that you want at boot.
  
== Others ==
+
If you wish to start one temporarily, you can start a getty service at the desired TTY by typing:
  
* '''mingetty''' AUR {{AUR|mingetty}}
+
$ systemctl start getty@ttyN.service
* '''[[qingy]]''' official package: {{Pkg|qingy}}
+
* '''fbgetty''' official package: {{Pkg|fbgetty}}
+
* '''ngetty''' AUR: {{AUR|ngetty}}
+
* '''rungetty''' AUR: {{AUR|rungetty}}
+
* '''mgetty''' AUR: {{AUR|mgetty}}
+
  
== See also ==
+
=== Automatic login to virtual console ===
 +
 
 +
==== Configuration ====
 +
 
 +
Configuration relies on systemd [[Systemd#Editing provided units|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 {{ic|tty''N''}}, where {{ic|''N''}} is a number). The configuration of automatic login for serial consoles will be slightly different. Device names of the serial consoles look like {{ic|ttyS''N''}}, where {{ic|''N''}} is a number.
 +
 
 +
==== Virtual console ====
 +
 
 +
[[systemd#Editing provided units|Edit the provided unit]] either manually by creating the following drop-in snippet, or by running {{ic|systemctl edit getty@tty1}} and pasting its content:
 +
 
 +
{{hc|/etc/systemd/system/getty@tty1.service.d/override.conf|2=
 +
[Service]
 +
ExecStart=
 +
ExecStart=-/usr/bin/agetty --autologin ''username'' --noclear %I $TERM
 +
}}
 +
 
 +
{{Tip|The option {{ic|1=Type=idle}} found in the default {{ic|getty@.service}} will delay the service startup until all jobs (state change requests to units) are completed in order to avoid polluting the login prompt with boot-up messages. When [[Start X at login|starting X automatically]], it may be useful to start {{ic|getty@tty1.service}} immediately by adding {{ic|1=Type=simple}} into the [[drop-in snippet]]. Both the init system and ''startx'' can be [[Silent boot|silenced]] to avoid the interleaving of their messages during boot-up.}}
 +
 
 +
If you want to use a ''tty'' other than ''tty1'', see [[Systemd FAQ#How_do_I_change_the_default_number_of_gettys.3F|systemd FAQ]].
 +
 
 +
==== Serial console ====
 +
 
 +
Create the following file (and leading directories):
 +
 
 +
{{hc|/etc/systemd/system/serial-getty@ttyS0.service.d/autologin.conf|2=
 +
[Service]
 +
ExecStart=
 +
ExecStart=-/usr/bin/agetty --autologin ''username'' -s %I 115200,38400,9600 vt102
 +
}}
 +
 
 +
====See also====
 +
 
 +
* [[Systemd#Change_default_target_to_boot_into|Change default runlevel/target to boot into]]
 +
 
 +
== Others ==
  
* [[Display manager]]
+
See [[List of applications#getty]].
* [[Disable clearing of boot messages]]
+
* [[Automatic login to virtual console]]
+

Latest revision as of 12:03, 21 July 2016

Tango-view-fullscreen.pngThis article or section needs expansion.Tango-view-fullscreen.png

Reason: please use the first argument of the template to provide a brief explanation. (Discuss in Talk:Getty#)

A getty is the generic name for a program which manages a terminal line and its connected terminal. Its purpose is to protect the system from unauthorized access. Generally, each getty process is started by systemd and manages a single terminal line.

agetty

agetty — Agetty is the default getty in Arch Linux. It modifies the TTY settings while waiting for a login so that the newlines are not translated to CR-LFs. This tends to cause a "staircase effect" for messages printed to the console. Agetty manages virtual consoles and six of these virtual consoles are provided by default in Arch Linux. They are usually accessible by pressing Ctrl+Alt+F1 through Ctrl+Alt+F6.

https://www.kernel.org/pub/linux/utils/util-linux/ || util-linux

Add additional virtual consoles

Open the file /etc/systemd/logind.conf and set the option NAutoVTs=6 to the number of virtual terminals that you want at boot.

If you wish to start one temporarily, you can start a getty service at the desired TTY by typing:

$ systemctl start getty@ttyN.service

Automatic login to virtual console

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

Edit the provided unit either manually by creating the following drop-in snippet, or by running systemctl edit getty@tty1 and pasting its content:

/etc/systemd/system/getty@tty1.service.d/override.conf
[Service]
ExecStart=
ExecStart=-/usr/bin/agetty --autologin username --noclear %I $TERM
Tip: The option Type=idle found in the default getty@.service will delay the service startup until all jobs (state change requests to units) are completed in order to avoid polluting the login prompt with boot-up messages. When starting X automatically, it may be useful to start getty@tty1.service immediately by adding Type=simple into the drop-in snippet. Both the init system and startx can be silenced to avoid the interleaving of their messages during boot-up.

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

Serial console

Create the following file (and 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

Others

See List of applications#getty.