Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

In the directory /dev/pts I see 3 pts instances as shown in the screenshot below however when I run the command w I only see 1 instance of pts. Why is that?

/dev/pts

enter image description here

w

enter image description here

share|improve this question

1 Answer 1

up vote 1 down vote accepted

w does not deal with tty devices directly – it only displays those registered in /run/utmp. Programs (such as terminal emulators, or remote login daemons) usually register themselves to become visible in the w/who list, but are not required in any way to do so.

For example, the screen utility deregisters itself when you detach, despite keeping the pty devices allocated. A popular replacement of screen, tmux, never uses utmp – it isn't programmed to use it. Some terminal emulators do not register themselves simply due to lack of privileges (the program needs to have "setgid utmp" set). There could be more reasons, and not all of them malicious.

Use lsof or fuser to see all processes having those ptys open:

sudo fuser -v /dev/pts/*

sudo lsof /dev/pts/*
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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