3

Can anyone explain me the difference between vty and tty ?

I am getting the following when i execute tty .

[sce@..]# tty
/dev/pts/135

what is /dev/pts/135 here ?

5

TTy refers to teletype services in linux which is a shell command that can be entered interactively or as part of a script whether to determine whether the output for the script is a terminal.

Its process would be like this(image from ttydemystified) :

Pty Refers to pseudoterminal From Pty(7)

A pseudoterminal (sometimes abbreviated "pty") is a pair of virtual character devices that provide a bidirectional communication channel.

One end of the channel is called the master; the other end is called the slave. The slave end of the pseudoterminal provides an interface that behaves exactly like a classical terminal.

A process that expects to be connected to a terminal, can open the slave end of a pseudoterminal and then be driven by a program that has opened the master end.

Anything that is written on the master end is provided to the process on the slave end as though it was input typed on a terminal

/dev/pts - /Dev is an special type of file system, devpts, is mounted at /dev/pts,The entries in /dev/pts correspond to pseudo-terminals (or pseudo-TTYs, or PTYs). Linux creates a PTY for every new terminal window you open and displays a corresponding entry in /dev/pts.

The PTY device acts like a terminal device—it accepts input from the keyboard and displays text output from the programs that run in it. PTYs are numbered, and the PTY number is the name of the corresponding entry in /dev/pts.

The main difference b/w them is the type of connection to the computer(how it connects).

TTY ports are usually direct connections to the computer such as a keyboard/mouse or a serial connection to the device.

PTS connections are SSH connections or telnet connections.

Additional reference can be found here, Here, tty demystified

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.