4

Whenever I enter the who command in the SSH I see the PTS/1 after my username. Two days ago it was still PTS/0. Is this called the TTY?

How do I make it PTS/0 again? Also the path now is /dev/pts/1 and the shell is still /bin/bash.

Update: Whenever I kill a particular process the pts/0 returns. But when I start the process again it would become pts/1 again. Can I prevent this from happening?

Rui F Ribeiro
  • 56,709
  • 26
  • 150
  • 232
Joey
  • 199
  • If there's anyone who could answer my question on why a process could change the pts/...I'll be glad.Does this mean that process has opened up its own terminal? That's why when I connect I always go to pts/1. Forgive me if I'm really just confused and lost. Maybe I'm just paranoid that a process could intercept my commands. – Joey Jun 16 '16 at 22:09

1 Answers1

4

The pseudo-terminal slave, e.g.,/dev/pts/1 is allocated each time you open a terminal. It can be different if there is more than one terminal that has been opened.

Further reading:

Thomas Dickey
  • 76,765
  • I use SSH and PUTTY. I think I only have one terminal open everytime I connect on my server. And when I open a new instance of the shell, it always becomes pts/2. – Joey Jun 16 '16 at 09:31
  • Now I see something. If I kill a particular process, my username becomes pts/0 again. Please explain this and can I prevent this from happening? I discovered this when I restarted the server thinking that it would go away. But when I started that process the pts/0 became pts/1 again. Thanks for the links they were very helpful. – Joey Jun 16 '16 at 12:16
  • What is the "particular process" which you killed? – Thomas Dickey Jun 16 '16 at 22:31
  • It's the TeamTalk server. I'd start it by typing ./tt5srv -d. I'd kill it by typing kill pid or killall tt5srv. – Joey Jun 16 '16 at 22:41
  • Sounds like TeamTalk is opening a pseudo-terminal and whoever gets there first gets /dev/pts/0. I would not rely on a particular path, but just use the output of tty. – Thomas Dickey Jun 16 '16 at 22:44