Home

devpts

devpts is a Linux pseudo-filesystem that provides dynamic pseudo-terminal (PTY) devices used by terminal emulators, shells, and remote sessions. It is typically mounted at /dev/pts and works in conjunction with the master device /dev/ptmx. When a program opens /dev/ptmx, the kernel allocates a new PTY pair and exposes the corresponding slave device under /dev/pts, usually as /dev/pts/N. The slave acts as the controlling terminal for the process or session, enabling standard terminal behavior such as line discipline, job control, and signal delivery.

The devpts filesystem is part of the Linux TTY subsystem. The slave devices created under /dev/pts function

Namespaces and isolation: modern Linux supports separate devpts instances per user namespace or container, achievable with

Mount options and ownership: devpts accepts options to control permissions and ownership of the created PTY

In practice, most systems mount devpts automatically during boot or via /etc/fstab, enabling standard terminal functionality

like
traditional
terminals,
providing
the
necessary
interfaces
for
input
and
output
that
terminal-based
programs
rely
on.
This
dynamic
allocation
replaces
the
older
approach
of
static,
purely
device-file-based
PTYs.
the
newinstance
mount
option.
This
allows
different
namespaces
to
have
independent
sets
of
PTYs,
improving
isolation
in
containers
and
other
virtualization
scenarios.
nodes.
Common
options
include
gid
to
set
the
group
ownership,
mode
to
define
permissions
for
the
slave
devices,
and
ptmxmode
to
control
the
permissions
of
/dev/ptmx.
The
exact
options
can
vary
by
kernel
version
and
distribution.
for
local
and
remote
logins,
as
well
as
for
tools
such
as
SSH,
screen,
and
tmux.