Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
1
votes
1
answers
4314
views
getty@tty1.service FAILED - Autologin only shows on TTY1 a flashing _
I'm working on a minecraft server with OS Ubuntu server 20.04 So far they haven't given me any problems (it's fantastic!), I know some things about linux (some don't exaggerate) Until something came to me. I'll be out of the house, but I'll have my laptop. The problem is the following, I want to pla...
I'm working on a minecraft server with OS Ubuntu server 20.04
So far they haven't given me any problems (it's fantastic!), I know some things about linux (some don't exaggerate)
Until something came to me. I'll be out of the house, but I'll have my laptop.
The problem is the following, I want to play minecraft with my friends but every time I start the computer it asks me to enter the password.
Things I'd like to do: Enable Auto-login
What I've already tried:
systemctl edit getty@tty1.service
[Service]
ExecStart=
ExecStart=-/usr/bin/agetty --autologin simao --noclear %I 38400 linux
I've also tried replacing the last line with ExecStart=-/usr/bin/agetty --autologin simao --noclear %I %TERM
What happens when turning off and on again: On tty1 appears the normal starting and then only a flashing _
When running the following command sudo systemctl --failed
Gives the following output
UNIT LOAD ACTIVE SUB DESCRIPTION
getty@tty1.service loaded failed failed Getty on tty1
Then I ran the following command sudo systemctl status getty@tty1.service
And gives the following output "
getty@tty1.service - Getty on tty1
Loaded: loaded (/lib/systemd/system/getty@.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/getty@tty1.service.d
└─override.conf
Active: failed (Result: start-limit-hit) since Mon 2022-07-25 12:39:35 UTC; 11min ago
Docs: man:agetty(8)
man:systemd-getty-generator(8)
http://0pointer.de/blog/projects/serial-console.html
Process: 1077 ExecStart=/usr/bin/agetty --autologin simao --noclear tty1 38400 linux (code=exited, status=0/SUCCESS)
Main PID: 1077 (code=exited, status=0/SUCCESS)
Jul 25 12:39:35 minecraft-server-simao-vilas systemd: getty@tty1.service: Succeeded.
Jul 25 12:39:35 minecraft-server-simao-vilas systemd: getty@tty1.service: Scheduled restart job, restart counter is at 5.
Jul 25 12:39:35 minecraft-server-simao-vilas systemd: Stopped Getty on tty1.
Jul 25 12:39:35 minecraft-server-simao-vilas systemd: getty@tty1.service: Start request repeated too quickly.
Jul 25 12:39:35 minecraft-server-simao-vilas systemd: getty@tty1.service: Failed with result 'start-limit-hit'.
Jul 25 12:39:35 minecraft-server-simao-vilas systemd: Failed to start Getty on tty1.
EDIT: If someone needs more info, only ask and i will edit the post with the info right away (not exactly but the fast i can)
Devilas
(87 rep)
Jul 25, 2022, 11:55 AM
• Last activity: Jun 9, 2025, 03:09 PM
1
votes
1
answers
40
views
Connect Minitel1B to Ubuntu 20.04
I'm trying to use a Minitel as a console to connect to my Ubuntu. I've read a lot of information about this, but it seems to work with older versions of Ubuntu. These two files : - etc/inittab - etc/gettydefs ... don't do the job for me ! My inittab: 1:2345:respawn:/sbin/agetty ttyUSB0 4800v23 My ge...
I'm trying to use a Minitel as a console to connect to my Ubuntu. I've read a lot of information about this, but it seems to work with older versions of Ubuntu.
These two files :
- etc/inittab
- etc/gettydefs
... don't do the job for me !
My inittab:
1:2345:respawn:/sbin/agetty ttyUSB0 4800v23
My gettydefs :
4800v23# B4800 CS7 PARENB -PARODD GLOBAL # B4800 ISTRIP CS7 PARENB -PARODD GLOBAL BRKINT IGNPAR ICRNL IXON IXANY OPOST ONLCR CREAD HUPCLISIG ICANON ECHO ECHOE ECHOK #@S login: #4800v23
The result of "sudo lsusb -v" :
Bus 003 Device 002: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 255 Vendor Specific Class
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x1a86 QinHeng Electronics
idProduct 0x7523 HL-340 USB-Serial adapter
bcdDevice 2.64
iManufacturer 0
iProduct 2 USB Serial
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 0x0027
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 98mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 3
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 1
bInterfaceProtocol 2
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0020 1x 32 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0020 1x 32 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 1
can't get debug descriptor: Resource temporarily unavailable
Device Status: 0x0000
(Bus Powered)
Today I can do this :
sudo stty -F /dev/ttyUSB0 4800 parenb cs7 hupcl cread ignpar clocal ixon ixoff opost onlcr isig echoe echok echoctl echoke
and this :
echo "Hello Minitel" > /dev/ttyUSB0
... prints
Hello Minitel
on my Minitel screen. But I'm not able to have a prompt on my minitel.
Thanks for your help, and sorry for my "poor english" (I'm an old french developer ;)
DroiTof
(11 rep)
Feb 13, 2025, 10:50 AM
• Last activity: Feb 13, 2025, 06:51 PM
2
votes
2
answers
1952
views
No login prompt from Getty over serial console
My Ubuntu 20.04 system has a serial port over which I would like to provide console access. I can confirm that I can communicate over the serial port with sudo picocom -b 115200 /dev/ttyS5 I start the Getty instance with sudo systemctl start serial-getty@ttyS5 which starts the command /sbin/agetty -...
My Ubuntu 20.04 system has a serial port over which I would like to provide console access.
I can confirm that I can communicate over the serial port with
sudo picocom -b 115200 /dev/ttyS5
I start the Getty instance with
sudo systemctl start serial-getty@ttyS5
which starts the command
/sbin/agetty -o '-p -- \u' --keep-baud 115200,38400,9600 ttyS5 vt220
However, no login prompt appears on the remote system.
rgov
(253 rep)
Mar 28, 2022, 05:07 PM
• Last activity: Jun 15, 2024, 04:00 AM
0
votes
1
answers
105
views
What is the equivalent of "clear line con 0"?
What is the equivalent of `clear line con 0` in Cisco IOS? I'm using `serial-getty@ttyS0`.
What is the equivalent of
clear line con 0
in Cisco IOS?
I'm using serial-getty@ttyS0
.
viator
(77 rep)
May 5, 2024, 08:36 AM
• Last activity: May 5, 2024, 03:16 PM
5
votes
1
answers
728
views
job control doesn't work when I try to set up getty over serial
I am trying to set up getty to log in over serial (mainly as an experiment). With almost any configuration, the same thing happens. If my default shell is `bash`, I get this message after I log in: ``` -bash: cannot set terminal process group (15297): Inappropriate ioctl for device -bash: no job con...
I am trying to set up getty to log in over serial (mainly as an experiment).
With almost any configuration, the same thing happens. If my default shell is
bash
, I get this message after I log in:
-bash: cannot set terminal process group (15297): Inappropriate ioctl for device
-bash: no job control in this shell
and then to prove that it doesn't work, I can't use ctrl+C to stop programs:
$ sleep 30
^C
and it doesn't seem to send the signal.
These are the configurations I have tried:
I have tried both of these commands
# copied from raspberry pi:
sudo /sbin/agetty --keep-baud 115200,38400,9600 ttyUSB0 vt220
# something else I read somewhere
sudo getty -L ttyUSB0 9600 vt100
# (I know I'm mixing and matching a lot of differences but the result is the same)
I have tried both screen and picocom as a client.
I have tried using a rasberry pi as a server, and two different ubuntu laptops.
I have tried two FTDIs, two RS-485 usb adapters, and a built in RS232 on the getty side with a USB RS232 on the client side.
I have also tried changing my default shell to sh and dash. I don't get the message, but ctrl+C still doesn't work as expected
The funny thing is - when raspberry pi's automatically configure /dev/ttyAMA0
, and it uses exactly the getty command that I have put, job control works!
And the terminal settings are almost identical. (except for -iutf8 actually)
here are the terminal settings with the FTDI connection, and picocom running:
$ stty -a -F /dev/ttyUSB0
speed 9600 baud; rows 24; columns 80; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D;
eol = ; eol2 = ; swtch = ; start = ^Q;
stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W;
lnext = ; discard = ; min = 1; time = 0;
-parenb -parodd -cmspar cs8 hupcl -cstopb cread clocal
-crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr
-icrnl ixon ixoff -iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0
tab0 bs0 vt0 ff0
isig -icanon -iexten -echo echoe echok -echonl -noflsh -xcase
-tostop -echoprt echoctl echoke -flusho -extproc
$ stty -a -F /dev/ttyUSB1
speed 9600 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D;
eol = ; eol2 = ; swtch = ; start = ^Q;
stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V;
discard = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 hupcl -cstopb cread clocal
-crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr
-icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8
-opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0
cr0 tab0 bs0 vt0 ff0
-isig -icanon -iexten -echo echoe echok -echonl -noflsh -xcase
-tostop -echoprt echoctl echoke -flusho -extproc
What am I doing wrong? And why does it work with the built in configuration for the built in serial port on the raspberry pi?
Alex028502
(643 rep)
Mar 10, 2024, 07:25 PM
• Last activity: Mar 11, 2024, 08:03 AM
0
votes
0
answers
55
views
What is the source of this tty console output?
I'm making a kiosk system using Armbian on an orangepi zero 3. The kiosk is a on a local server that I connect to using chromium browser launched from my `~/.bash_profile`. Before chromium-browser starts up `getty@tty1.service` is launched and autologs in my user. When the getty terminal launches th...
I'm making a kiosk system using Armbian on an orangepi zero 3. The kiosk is a on a local server that I connect to using chromium browser launched from my
~/.bash_profile
. Before chromium-browser starts up getty@tty1.service
is launched and autologs in my user. When the getty terminal launches there's a line that prints and I can't seem to find the source. The line printed is Armbian 23.08.0-trunk Jammy tty1
I've tried changing sysctl kernel.printk
to all zeros and dmesg -n 1
but neither of these work.
soccermom420
(1 rep)
Sep 15, 2023, 04:44 PM
• Last activity: Sep 18, 2023, 03:10 PM
2
votes
1
answers
1479
views
Debian VM doesn’t boot on QEMU with "console=hvc0" kernel parameter
I’m running virtual linux machine (debian12) on QEMU with ```-device virtconsole``` argument. That argument adds **/dev/hvcX** device nodes to VM. QEMU can connect that device to unix socket on host. If i pass “console=hvc0” parameter to VM’s kernel i get console on host socket and can launch tty on...
I’m running virtual linux machine (debian12) on QEMU with
-device virtconsole
argument. That argument adds **/dev/hvcX** device nodes to VM. QEMU can connect that device to unix socket on host. If i pass “console=hvc0” parameter to VM’s kernel i get console on host socket and can launch tty on it. However it works only if i configure alongside another one console kernel parameter, e.g. =ttyAMA0 console=hvc0
. The problem is that VM doesn’t boot with single =hvc0
kernel parameter. Am i missing something?
The whole QEMU command:
qemu-system-aarch64 \
-M virt,accel=hvf,highmem=off \
-cpu host \
-smp 2 \
-m 2048 \
-display none \
-daemonize \
-monitor unix:/tmp/qemu-monitor-socket,server=on,wait=off \
-device virtio-serial-pci \
-chardev socket,path=/tmp/qemu-guest-tty,server=on,wait=off,id=guest-tty \
-device virtconsole,chardev=guest-tty \
-device virtio-net-pci,netdev=mynet0,mac=52:54:00:08:06:8b \
-netdev user,id=mynet0,hostfwd=tcp::22221-:22 \
-device virtio-blk-pci,drive=hda \
-drive file=~/qemu/debian/1-debian-12-genericcloud-arm64.qcow2,format=qcow2,discard=unmap,id=hda,if=none \
-cdrom ~/qemu/cloud-init/cloud-init.iso \
-kernel ~/qemu/debian/vmlinuz-6.1.0-9-cloud-arm64 \
-initrd ~/qemu/debian/initrd.img-6.1.0-9-cloud-arm64 \
-append 'root=/dev/vda1 ds=nocloud;h=debian1 console=hvc0'
UPD: Problem existing only in Debian. I've tested Ubuntu, Fedora and openSUSE - they boot normally with
configured as the only console. All distributions i've tested were latest "cloud" ARM64 images. I've tried debian-12-genericcloud and debian-11-genericcloud images with same result.
xycainoff
(23 rep)
Jul 18, 2023, 10:22 PM
• Last activity: Aug 21, 2023, 02:27 PM
5
votes
3
answers
3807
views
Linux Terminal autologin only once after reboot
I'm trying to have my computer automatically log in as a specific user after reboot on an Arch Linux machine. I followed the [guide from the Arch Linux Wiki][1], ran `# systemctl edit getty@tty1` and pasted the following lines: [Service] ExecStart= ExecStart=-/usr/bin/agetty --autologin username --n...
I'm trying to have my computer automatically log in as a specific user after reboot on an Arch Linux machine. I followed the guide from the Arch Linux Wiki , ran
# systemctl edit getty@tty1
and pasted the following lines:
[Service]
ExecStart=
ExecStart=-/usr/bin/agetty --autologin username --noclear %I $TERM
This works and I'm automatically logged in and everything. However, when I press CTRL+D to log out because I want to log in as someone else, autologin is triggered and I'm immediately logged back in. How can I configure autologin to only automatically log me in the first time after boot and do nothing when I manually log out?
Rapti
(217 rep)
Mar 13, 2016, 01:26 PM
• Last activity: Apr 12, 2023, 06:34 PM
0
votes
1
answers
230
views
Dumb terminal agetty keyboard layout filter
I recently acquired an old Heathkit dumb terminal, and I would like to get it working with the colemak keyboard layout. Because the terminal sends ascii codes directly over serial, I don't believe anything like `loadkeys` will work. (If there *is* a simple solution to changing the layout, I'd love t...
I recently acquired an old Heathkit dumb terminal, and I would like to get it working with the colemak keyboard layout. Because the terminal sends ascii codes directly over serial, I don't believe anything like
loadkeys
will work. (If there *is* a simple solution to changing the layout, I'd love to know.)
My current plan is to filter every byte that is received or transmitted in a simple piece of software. There are also a few command line programs that still use incompatible escape codes (despite TERM
being set correctly) which I would like to manually filter out as well.
Essentially I'd like to create a program that sits between agetty and the terminal and allows me to filter bytes manually as they are sent or received.
The filtering of bytes is simple enough, but I'm unsure how to create an interface to agetty that can do this. Will I need to create my own device using mknod
?
(I've also considered using a microcontroller or raspberry pi sitting between the terminal and linux machine to read bytes in and write the new bytes out. This solution would be clunky and I'd like to avoid it if possible.)
Any advice on where to look/read would be extremely helpful.
runrin
(31 rep)
Jun 12, 2022, 10:13 PM
• Last activity: Jun 13, 2022, 06:08 AM
1
votes
1
answers
2916
views
Relationship between framebuffer and a tty
A framebuffer is a device file which allows for a simplified interface to the screen. For example running the below code on a RaspberryPi with a HDMI display connected: ``` cat /dev/urandom > /dev/fb1 ``` There are commands (`fbi`, `fim`) which allow for injecting full images into the framebuffer. T...
A framebuffer is a device file which allows for a simplified interface to the screen.
For example running the below code on a RaspberryPi with a HDMI display connected:
cat /dev/urandom > /dev/fb1
There are commands (fbi
, fim
) which allow for injecting full images into the framebuffer.
There are multiple resources on the internet ([ref1](https://www.linuxquestions.org/questions/linux-software-2/run-fbi-as-a-systemd-service-4175643447/) , [ref2](https://yingtongli.me/blog/2016/12/21/splash.html) , [ref3](https://stackoverflow.com/questions/46143476/why-does-fbi-not-show-splash-image-during-system-startup)) trying to more or less succesfully explain how to add make a systemd service which will result in an image on the screen.
A common thread in those resources is the mentioning tty
together with the framebuffer
. (i.e. both fbi
and fim
have options to pass them a tty
).
---
My assumption was that a tty
is a separated concept from a framebuffer
.
The tty
uses the framebuffer
to output content to a user, but the framebuffer isn't in any way tied to a tty
.
Is there a hidden relationship behind a tty
and a framebuffer
which could explain why commands to print images to a framebuffer
seem to depend on a tty
?
TheMeaningfulEngineer
(6220 rep)
May 31, 2022, 01:07 PM
• Last activity: May 31, 2022, 04:49 PM
0
votes
1
answers
58
views
Emacs escaping getty
I create two virtual serials by socat -d -d pty,raw,echo=0 pty,raw,echo=0 in the specific case, I got /dev/pts/9 and /dev/pts/16 I then start screen on one side, in one X terminal, specifically gnome-terminal (for what it matters) screen /dev/pts/9 9600 vt52 and getty on the other side (from root),...
I create two virtual serials by
socat -d -d pty,raw,echo=0 pty,raw,echo=0
in the specific case, I got /dev/pts/9 and /dev/pts/16
I then start screen on one side, in one X terminal, specifically gnome-terminal (for what it matters)
screen /dev/pts/9 9600 vt52
and getty on the other side (from root), in another X terminal (again, gnome-terminal)
getty pts/16 9600 vt52
I then login in the screen terminal.
I can ls, etc. However, when I launch emacs (inside screen,thus NOT graphical) I get emacs's output on the getty's terminal, instead of inside screen's terminal. How is that possible? How can I fix that?
I do not know if that's related, but when I login I get
-bash: cannot set terminal process group (64718): Inappropriate ioctl for device
-bash: no job control in this shell
Fabio Dalla Libera
(119 rep)
Dec 21, 2021, 03:53 AM
• Last activity: Dec 23, 2021, 07:47 AM
0
votes
1
answers
1231
views
Serial on host stops working during boot
I'm running Proxmox 6.4 with kernel 5.4.103-1-pve (I've already asked this question in their forums with no luck). My motherboard has a COM header, so I recently got the equipment I needed to hook it up and manage via serial. However, I'm unable to use serial after the system is booted. The port is...
I'm running Proxmox 6.4 with kernel 5.4.103-1-pve (I've already asked this question in their forums with no luck). My motherboard has a COM header, so I recently got the equipment I needed to hook it up and manage via serial. However, I'm unable to use serial after the system is booted. The port is at
ttyS0
. I set it up in GRUB (note that my setup is serial-only until SSH comes up, the only GPU in the system is not actually used by GRUB or Linux, only for passthrough):
GRUB_TERMINAL=serial
GRUB_SERIAL_COMMAND="serial --unit=0 --speed=115200"
And then I set it up for Linux, by adding console=ttyS0,115200
to the kernel command line. Now, when I boot the host, I first see the GRUB menu, and can interact with it fully, and then I see the normal loading initramfs messages, followed by most of the normal Linux boot process. However, once it gets to the "Login Service", there is no longer any output and I cannot interact with the terminal:
...
Starting Proxmox VE Login Banner...
Starting Enable support fo…l executable binary formats...
[ OK ] Reached target ZFS volumes are ready.
[ OK ] Started Preprocess NFS configuration.
[ OK ] Started Set console font and keymap.
[ OK ] Started Create Volatile Files and Directories.
[ OK ] Started Load AppArmor profiles.
[ OK ] Started Proxmox VE firewall logger.
Mounting Arbitrary Executable File Formats File System...
Starting Raise network interfaces...
[ 17.623601] Generic FE-GE Realtek PHY r8169-800:00: attached PHY driver [Generic FE-GE Realtek PHY] (mii_bus:phy_addr=r8169-800:00, irq=IGNORE)
Starting Network Time Synchronization...
Starting Update UTMP about System Boot/Shutdown...
Starting RPC bind portmap service...
[ OK ] Reached target NFS client services.
[ OK ] Started Proxmox VE Login Banner.
[ OK ] Started Commit Proxmox VE network changes.
[ OK 17.739718] r8169 0000:08:00.0 enp8s0: Link is Down
0m] Mounted Arbitrary Executable File Formats File System.
[ OK ] Started 17.760897] 8021q: 802.1Q VLAN Support v1.8
1;39mRPC bind portmap service.
[ OK ] Started Network Time Synchronization.
[ OK ] Started Enable support for…nal executable binary formats.
[ OK ] Reached target System Time Synchronized.
[ OK ] Reached target RPC Port Mapper.
[ OK ] Started Update UTMP about System Boot/Shutdown.
[ OK ] Reached target System Initialization.
[ OK ] Listening on D-Bus System Message Bus Socket.
[ OK ] Reached target Sockets.
[ OK ] Reached target Basic System.
Starting Proxmox VE LXC Syscall Daemon...
[ OK ] Started D-Bus System Message Bus.
Starting PVE Qemu Event Daemon...
[ OK ] Started ZFS Event Daemon (zed).
Starting System Logging Service...
[ OK ] Started Daily apt download activities.
[ OK ] Started Daily apt upgrade and clean activities.
Starting LSB: The monitor UPS software....
[ OK ] Started Daily rotation of log files.
[ OK ] Started Daily man-db regeneration.
Starting Login Service...
[ OK ] Started Proxmox VE [ 18.118065] softdog: initialized. soft_noboot=0 soft_margin=60 sec soft_panic=0 (nowayout=0)
watchdog multiplexer.
Starting Kernel Samepage Merging (KSM) Tuning Daemon...
[ OK ] Started Daily Cleanup of Temporary Directories.
[ OK ] Started Daily PVE download activities.
Starting Self Monitoring a…g Technology (SMART) Daemon...
Starting ZFS file system shares...
[ OK ] Started Proxmox VE replication runner.
[ OK ] Reached target Timers.
[ OK ] Started FUSE filesy[ 18.258047] new mount options do not match the existing superblock, will be ignored
stem for LXC.
Starting Initialize hardware monitoring sensors...
[ OK ] Started Proxmox VE LXC Syscall Daemon.
[ OK ] Started System Logging Service.
[ OK ] Started PVE Qemu Event Daemon.
[ OK ] Started Kernel Samepage Merging (KSM) Tuning Daemon.
[ OK ] Started ZFS file system shares.
[ OK ] Reached target ZFS startup target.
[ OK ] Started Initialize hardware monitoring sensors.
[ OK ] Started Login Service.
If I SSH in, I can see that the serial-getty@ttyS0
service is running, and its journal shows zero errors or warnings. Similarly, dmesg
and the syslog have no errors about this. Even if I restart the service, the serial terminal still doesn't work. If I run stty -a -F /dev/ttyS0
, I can see that for some reason, the baud rate is set to 2400, even though it was correct during boot. I can manually set it back to 115200 baud, but if I do that and then type anything on the client side of the terminal, it immediately reverts to 2400 after showing that character. However, if I manually reset it and then restart serial-getty@ttyS0
, it maintains 115200 baud and remains interactive.
I've been unable to find a solution anywhere on the internet, perhaps my Google-fu is not strong enough but it's difficult to find a similar issue where it works partially, unlike what most people experience, where it doesn't work at all.
**EDIT**:
This is now fixed, thanks to telcoM. For reference, the default ExecStart
line was:
ExecStart=-/sbin/agetty -o '-p -- \\u' --keep-baud 115200,38400,9600 %I $TERM
So running systemctl edit serial-getty@ttyS0
and adding the following lines fixed it:
[Service]
ExecStart=
ExecStart=-/sbin/agetty -o '-p -- \\u' 115200 %I $TERM
Daniel Hellstern
(3 rep)
May 17, 2021, 11:53 PM
• Last activity: May 19, 2021, 07:25 AM
3
votes
1
answers
2779
views
how to start a new terminal with agetty (not systemd)
For the sake of learning, I wanted to start a new terminal (let's say tty10) from the command prompt. I know I can just run `sudo systemctl start getty@tty10.service`, but I want to run it manually for now. I checked systemd service getty@ and it uses the following command line: /sbin/agetty -o '-p...
For the sake of learning, I wanted to start a new terminal (let's say tty10) from the command prompt. I know I can just run
sudo systemctl start getty@tty10.service
, but I want to run it manually for now. I checked systemd service getty@ and it uses the following command line:
/sbin/agetty -o '-p -- \\u' --noclear %I $TERM
So, trying to replicate that from a terminal (tty1) I ran this:
sudo /sbin/agetty -o '-p -- ' --noclear tty10 linux
It indeed started a new login prompt at terminal 10, I enter the username but it never prompts for a password. Besides, when I go back to terminal 1 I see it logged out. What am I doing wrong?
Adriano_epifas
(216 rep)
Oct 2, 2019, 08:34 PM
• Last activity: May 10, 2021, 04:35 PM
2
votes
1
answers
7694
views
What is this openvt command doing?
What is this command really doing (step by step)? openvt -c 40 /bin/agetty tty40 linux I tried this command instead : openvt -c 41 /bin/agetty tty40 linux and agetty was started on tty40 (not tty41). Why is that? It seems the `-c 41` option is not necessary. Removing it yields the same result.
What is this command really doing (step by step)?
openvt -c 40 /bin/agetty tty40 linux
I tried this command instead :
openvt -c 41 /bin/agetty tty40 linux
and agetty was started on tty40 (not tty41). Why is that? It seems the
-c 41
option is not necessary. Removing it yields the same result.
Gradient
(3749 rep)
Apr 8, 2017, 03:27 PM
• Last activity: Jan 11, 2021, 10:39 PM
1
votes
0
answers
1974
views
Systemd ordering: after multi-user.target before getty.target?
I have an installer which I turned into a systemd service it needs, * `networking.target` to be online * `multi-user.target` to be online I want my installer service to run after the above but **before** `getty.target` and `console-getty.service`. This is because I do not want the console to spam fo...
I have an installer which I turned into a systemd service it needs,
*
networking.target
to be online
* multi-user.target
to be online
I want my installer service to run after the above but **before** getty.target
and console-getty.service
. This is because I do not want the console to spam for a login before the installer is complete.
However, my distro (Centos 7) specifies a dependency on multi-user.target
to getty.target
,
/usr/lib/systemd/system/multi-user.target.wants/getty.target
This means I can't put my service between the two, because my service will then be
* Dependent on multi-user.target
* Which is dependent on getty.target
* While my service is specified to BEFORE getty.target
, and AFTER multi-user.target
What should I do given my needs here? Is there a way to do this by customizing /etc
without mucking with /usr/lib
so it's safe with the distro?
Evan Carroll
(34663 rep)
Nov 23, 2020, 12:48 AM
1
votes
0
answers
136
views
Key mapping on a physical terminal (Teleray 1060) when using getty
I have an old physical terminal (Teleray 1060) that I am attempting to use as a Linux terminal using getty. I have started a login session just fine. However, my terminal lacks an enter key, having both a carriage return and a line feed key. Neither of these function as an enter key so I am unable t...
I have an old physical terminal (Teleray 1060) that I am attempting to use as a Linux terminal using getty. I have started a login session just fine. However, my terminal lacks an enter key, having both a carriage return and a line feed key. Neither of these function as an enter key so I am unable to login. Would it be possible to reassign the carriage return to function as an enter key. I am very inexperienced whith Linux.
I am using Xubuntu 20.04.1 and a USB to serial cable.
Ctrl+M works on a virtual terminal.
I tried using Ubuntu 18.04.5 and now it seems to work fine. Is there something that has been changed between the two versions which may affect this?
The command used to start login session:
enable serial-getty@007.service --now
Output of -a
as root on virtual terminal:
38400 baud; rows 46; columns 94; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = ^E; eol2 = ;
swtch = ; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V;
discard = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany
-imaxbel iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo
Thanks
carlWheezer
(11 rep)
Sep 25, 2020, 10:35 AM
• Last activity: Sep 26, 2020, 01:29 AM
2
votes
3
answers
16107
views
Serial Getty error messages
I've a cloud server, with CentOS distribution, and an Apache instance to manage some web apps, like Wordpress or PrestaShop. I noticed that an error is reported in log files (`var/log/`). * In particular in `messages`: ``` May 30 11:54:41 xxx00962 systemd: Starting Serial Getty on ttyS0... May 30 11...
I've a cloud server, with CentOS distribution, and an Apache instance to manage some web apps, like Wordpress or PrestaShop.
I noticed that an error is reported in log files (
var/log/
).
* In particular in messages
:
May 30 11:54:41 xxx00962 systemd: Starting Serial Getty on ttyS0...
May 30 11:54:41 xxx00962 systemd: Started Serial Getty on ttyS0.
May 30 11:54:51 xxx00962 systemd: serial-getty@ttyS0.service holdoff time over, scheduling restart.
May 30 11:54:51 xxx00962 systemd: Stopping Serial Getty on ttyS0...
* and in secure
:
May 30 15:51:30 xxx00962 agetty: /dev/ttyS0: not a character device
where xxx00962
is the (anonymized) hostname.
I don't know what is getty
for, but I'd like to solve the problem.
Someone can help me and explain how getty
works?
Round Robin
(21 rep)
May 31, 2018, 09:09 AM
• Last activity: Jun 24, 2020, 10:11 AM
0
votes
2
answers
1060
views
How do I configure passwordless serial console access on CentOS 8?
This [official Red Hat page][1] offers some vague hints. > Since /etc/securetty listed many possible devices so that the > practical effect in most cases was to allow by default, this change > has only a minor impact. However, if you use a more restrictive > configuration, you need to add a line ena...
This official Red Hat page offers some vague hints.
> Since /etc/securetty listed many possible devices so that the
> practical effect in most cases was to allow by default, this change
> has only a minor impact. However, if you use a more restrictive
> configuration, you need to add a line enabling the pam_securetty.so
> module to the appropriate files in the /etc/pam.d directory, and
> create a new /etc/securetty file.
It seems odd there is no cleaner way of allowing passwordless serial console access.
This page provides a solution that works well enough but I can't help wondering if there is a simpler way.
user189395
(152 rep)
Dec 19, 2019, 12:30 AM
• Last activity: Jun 15, 2020, 07:49 PM
1
votes
0
answers
690
views
How to use host PTY in container?
I'm learning about container technologies of Linux and wrote a minimal container implementation on my own. I'm currently confused about consoles / terminals for container processes, as I'm "reusing" the controlling terminal as `/dev/console` (instead of `c 5 1`) in the container. I determine the cur...
I'm learning about container technologies of Linux and wrote a minimal container implementation on my own. I'm currently confused about consoles / terminals for container processes, as I'm "reusing" the controlling terminal as
I looked into the source code of
/dev/console
(instead of c 5 1
) in the container.
I determine the current terminal from /proc/self/fd/0
and /proc/self/fd/2
, read its device node (major and minor), and mknod(2)
using the discovered device nodes to create /dev/console
node in the container.
This appears fine when running a regular application like /bin/sh
as PID 1 (in PID namespace), but not when through an init system (I used BusyBox for this).
Here's my /etc/inittab
for the BusyBox rootfs:
::sysinit:/bin/true
::respawn:-/bin/sh
However, the shell spawned by init always complains can't access tty; job control turned off
. I also tried using the same host TTY node for /dev/tty
(instead of c 5 0
) but this problem still persists.

systemd-nspawn
and found that it creates a "forwarded pty" , where the container runs on a new PTY that's "forwarded" to the host side. The code is too complex for my educational project so it's not viable for me.
How can I use the host terminal for the container?
---
Details: My container program clone(2)
only one child with flags = CLONE_NEWGROUP | CLONE_NEWNET | CLONE_NEWPID | CLONE_NEWIPC | CLONE_NEWUTS | SIGCHLD
, and the child sets up capabilities (blacklisting) and seccomp (whitelisting, syscall list taken from Docker ), before pivot_root(2)
to the container rootfs and execve(2)
into the target application.
I'm currently experimenting on Linux 5.3 (Ubuntu 18.04 HWE), but I don't expect this to be different on any recent Linux versions.
iBug
(3638 rep)
Mar 18, 2020, 06:42 AM
• Last activity: Mar 18, 2020, 07:15 AM
0
votes
1
answers
836
views
No password prompt for serial connection
I want to setup a password prompt (root user) when login through minicom (serial connection). After running passwd command (connected through ssh), i can setup a password for the root user. After that I will be asked for a password with every ssh connection. But unfortunately not when I connect seri...
I want to setup a password prompt (root user) when login through minicom (serial connection). After running passwd command (connected through ssh), i can setup a password for the root user. After that I will be asked for a password with every ssh connection. But unfortunately not when I connect serially. Any idea how I can setup password prompt for serial connection?
andro_yamamoto
(1 rep)
Feb 14, 2020, 01:32 PM
• Last activity: Feb 20, 2020, 07:24 AM
Showing page 1 of 20 total questions