Hot answers tagged

15

The shell uses a TTY device (if it’s connected to one) to obtain user input and to produce output, and not much else. The fact that a shell is connected to a TTY is determined by getty (and preserved by login); most of the time the shell doesn’t care whether it’s connected to a TTY or not. Its interaction with the kernel happens via system calls. An X11 ...


13

There was a program named getty in 1st Edition Unix. The BSDs usually have a program named getty that is a (fairly) direct descendant of this. It (nowadays) reads /etc/ttys for the database of configured terminal devices and /etc/gettytab for the database of terminal line types (a line type being passed as an argument to the getty program). The Linux ...


11

After reading more on the internets I found out that a newer version of systemd requires a kernel with configuration option CONFIG_FHANDLE=y - however, this option is not present on the kernel version included in the official banana-pi ArchLinux image (3.4.90). I recompiled the kernel with the option included and now the login prompt appears as expected -> ...


9

agetty calls login after reading in the user name, so any timeout when reading the password is done by login. To change this, edit /etc/login.defs and change the LOGIN_TIMEOUT value. # # Max time in seconds for login # LOGIN_TIMEOUT 60


7

I solved that problem running : su root -c "getty /dev/ttyXX" I am running busybox 1.23.1 on an ARM platform.


5

By reading in the username, agetty can automatically adapt the tty settings like parity bits, character size, and newline processing. If you disable it (--skip-login options), it needs to assume (possibly wrong) default settings.


4

openvt -c 40 /bin/agetty tty40 linux runs openvt, directing it to use VT 40; so it opens that VT, and runs agetty on it. But specifying tty40 as an argument to agetty tells the latter to use VT 40 (regardless of where it was started), so it opens VT 40 itself and runs there. Thus, openvt -c 41 /bin/agetty tty40 linux opens VT 41, but then agetty opens VT ...


3

These are virtual consoles, known in Linux as virtual terminals (VT). There is a single hardware console (a single screen and a single keyboard), but Linux pretends that there are multiple ones (as many as 63). At a given point in time, a single VT is active; keyboard input is routed to that console and the screen shows what that console displays. You can ...


3

You can put literal escape characters into /etc/issue as suggested in a comment (Red Hat does this, sometimes). In a quick test, that works, but only colors the text. The background is uncolored. In vi, the text might look like ^[]P7000000^[]P0F0F0F0\S Kernel \r on an \m and the result like this: If you clear the screen, then the colors fill the window,...


3

You have hit a bug! There's a F_NONL directive that never gets called in the agetty binary as can be seen in the sources: ... #define F_NONL (1<<17) /* No newline before issue */ ... /* Parse command-line arguments. */ static void parse_args(int argc, char **argv, struct options *op) { int c; enum { VERSION_OPTION = CHAR_MAX +...


3

I don’t think /etc/tty0 is used in Ubuntu, I’m not sure where that file came from on your system. With sysvinit, the equivalent to /etc/ttys is /etc/inittab. You can see an example of an inittab with getty settings in Debian’s version. With systemd, there is no single equivalent file. getty setup is managed using the getty@ and getty-serial@ services.


3

The w command list users with shells and the corresponding terminal, so w | grep -e 'tty[0-9]' returns rc=0 if there is an open TTY session, and 1 if not.


2

In Arch, programs install defaults to /usr/lib. You should not be manually messing around in there (almost ever); definitely not with systemd. systemd provides overriding of default units for a reason (see the "Unit Load Path" section). Part of this is a security issue. The timeout checks back for negligence (e.g., you type your whole password, but forget to ...


2

You can edit the /etc/inittab file and comment out the unneeded ttys. Take a look at the inittab manpage here. If inittab doesn't exist, take a look at the /etc/ttys file. It also has a manpage here.


2

No. Once you start X, the VT stops being handled as a "text device" and becomes a "graphical" one. In the olden days the distinction was clear: either the VT was relying on BIOS (at least to some extent), knew just a few text modes and was blazingly fast, or it was switched to a graphical mode, had more colours and/or larger resolution and was slower. These ...


2

With /etc/inittab this could be done by configuring askfirst … Actually, it could not. That's a BusyBox init mechanism that doesn't exist in the Linux System 5 init clone, one of several ways in which their /etc/inittab configuration files are not the same things. The way to do similar things on a systemd Linux operating system depends from what ...


2

startx -- :1 startx -- :2 startx -- :3 startx -- :4


2

/etc/init/tty1.conf (and others) has a line that says: exec /sbin/getty -8 38400 tty1 just change the binary to qingy in some versions, these files may be under /etc/event.d you can do a lookup such as sudo locate tty1.conf


2

Take a look at the /etc/ttys file. It's kind of like gettytab in Linux. There's one line for each... terminal line. The "ttyuX" are for serial ports (different drivers have different device names, consult man pages, eg man uart for physical serial ports . What you need to do to enable them is to change the "off" (or "onifconsole") to "on", and notify ...


2

Check out man systemd-debug-generator. It is talking about boot options, but says you can also enable the feature permanently, as for any service: If the systemd.debug-shell option is specified, the debug shell service "debug-shell.service" is pulled into the boot transaction. It will spawn a debug shell on tty9 during early system startup. ...


2

The kernel has absolutely no concept of a login, or of who is logged in - all it cares about is that there are processes running under a certain user ID (who that is is also none of the kernel's business!). A login program, be it getty on a terminal or an X11 display manager, runs as root and then uses setuid() and related calls to setup an evironment for ...


2

I think you can modify /etc/motd, it will print the text contained on every user login. To change the TTY text which is shown before login, you should modify /etc/issue or /etc/issue.net. Only for SSH, you can also use Banner option in /etc/ssh/sshd_config to configure custom message for SSH. Source: http://www.linuxfromscratch.org/blfs/view/svn/postlfs/...


2

as far as i know agetty hasnt got that feature. So you would have to do it by yourself for example with a bash/perl/whatever script that saves a state if there was a previews login for this boot (directory restarted after reboot somehow) and then start the matching getty. the question is if you really need to do that work, you can also just change to tty2 (...


2

getty is one of the oldest Unix programs. You are using a workalike program written by Wietse Venema, agetty, that was written when getty was around twenty years old. This program is being run because your system thinks that you have a terminal attached to a serial device, with the character device filename /dev/ttyS0. When your system bootstrapped, a ...


2

Encryption means attacker can't access and modify your data (when the computer is not used ­– decrypted). If you log in, you must have physical access to computer to access data (attacker can read everything because sudo). There is no way for attacker to get to the system if you lock it using some program like vlock.


2

Apparently "recursive login" used to do something useful, but it has not been expected to work on Linux for a while now. I recommending sticking with the more commonly used techniques, such non-recursive login, or su and sudo, because these are better understood, documented, etc for current systems. Where possible, avoid su in favour of su -l, as this ...


2

/etc/inittab is the configuration file of classic SysVinit. Debian 9 uses systemd instead by default, although I think you still have an option to use another init system if you wish. With systemd, the getty processes (= those responsible for handling login prompts on TTY devices) are managed by getty@.service which is defined by file /lib/systemd/system/...


1

agetty expects a program to run for the -l option. You could make that (for instance) a Perl script, and make that provide the parameters, e.g., call this script myshell #!/usr/bin/perl exec 'bash --rcfile myprofile' and use the pathname of myshell in the agetty command. I used Perl because it does not read your bash (or sh) profile. If you use a script ...


1

agetty does not use /etc/gettydefs where getty uses /etc/gettydefs.


1

The source-code for agetty shows this chunk related to autobaud: /* Optionally detect the baud rate from the modem status message. */ debug("before autobaud\n"); if (serial_tty_option(&options, F_PARSE)) auto_baud(&termios); and the F_PARSE option is set here: case 'm': op->flags |= F_PARSE; break; which corresponds to ...


Only top voted, non community-wiki answers of a minimum length are eligible