2024-03-24 19:54:27 -03:00
|
|
|
# agetty
|
|
|
|
|
|
|
|
> Alternative `getty`: Open a `tty` port, prompt for a login name, and invoke the `/bin/login` command.
|
|
|
|
> It is normally invoked by `init`.
|
|
|
|
> Note: the baud rate is the speed of data transfer between a terminal and a device over a serial connection.
|
|
|
|
> More information: <https://manned.org/agetty>.
|
|
|
|
|
|
|
|
- Connect `stdin` to a port (relative to `/dev`) and optionally specify a baud rate (defaults to 9600):
|
|
|
|
|
|
|
|
`agetty {{tty}} {{115200}}`
|
|
|
|
|
2024-06-12 07:43:11 +02:00
|
|
|
- Assume `stdin` is already connected to a `tty` and set a timeout for the login:
|
2024-03-24 19:54:27 -03:00
|
|
|
|
2025-03-09 01:35:31 +02:00
|
|
|
`agetty {{[-t|--timeout]}} {{timeout_in_seconds}} -`
|
2024-03-24 19:54:27 -03:00
|
|
|
|
|
|
|
- Assume the `tty` is [8]-bit, overriding the `TERM` environment variable set by `init`:
|
|
|
|
|
|
|
|
`agetty -8 - {{term_var}}`
|
|
|
|
|
2024-06-12 07:43:11 +02:00
|
|
|
- Skip the login (no login) and invoke, as root, another login program instead of `/bin/login`:
|
2024-03-24 19:54:27 -03:00
|
|
|
|
2025-03-09 01:35:31 +02:00
|
|
|
`agetty {{[-n|--skip-login]}} {{[-l|--login-program]}} {{login_program}} {{tty}}`
|
2024-03-24 19:54:27 -03:00
|
|
|
|
2024-06-12 07:43:11 +02:00
|
|
|
- Do not display the pre-login (issue) file (`/etc/issue` by default) before writing the login prompt:
|
2024-03-24 19:54:27 -03:00
|
|
|
|
2025-03-09 01:35:31 +02:00
|
|
|
`agetty {{[-i|--noissue]}} -`
|
2024-03-24 19:54:27 -03:00
|
|
|
|
2024-06-12 07:43:11 +02:00
|
|
|
- Change the root directory and write a specific fake host into the `utmp` file:
|
2024-03-24 19:54:27 -03:00
|
|
|
|
2025-03-09 01:35:31 +02:00
|
|
|
`agetty {{[-r|--chroot]}} {{/path/to/root_directory}} {{[-H|--host]}} {{fake_host}} -`
|