I'm not sure exactly how the device nodes are created (i.e. the exact sequence of events that lead to their creation), but I'm pretty sure the kernel creates the underlying devices for the 63
/dev/ttyN devices (plus
/dev/tty) internally, and
udev does the work of making them available inside
/dev (except for
/dev/tty1 which are created by
I don't think you can limit the number of kernel devices via configuration.
Here is a workaround if you want to limit the number of devices that appear in your
/dev though. Create a
/etc/udev/rules.d/99-my-tty-rules.rules file and put something like the following in it:
KERNEL=="tty[2-9][0-9]", RUN="/bin/rm /dev/%k", OPTIONS+="ignore_device"
This will get rid of
tty device files numbered 20 and above.
rm in there looks really strange, but I can't find a way to not create the node in the first place
- Playing with these entries a bit too enthusiastically can lead to interesting problems - use with caution.