Why does `sudo` uses `/dev/pts/` terminal and `su` uses `pts/` terminal?

Solution Verified - Updated -

Issue

  • When user runs sudo command, it gets /dev/pts/* terminal
Apr 28 01:34:25 server sudo:     root : TTY=pts/2 ; PWD=/root ; USER=root ; COMMAND=/bin/ls
  • When user run su command, it gets pts/* terminal
type=USER_END msg=audit(1367092548.507:8228): user pid=8146 uid=0 auid=0 msg='PAM: session close acct="gs" : exe="/bin/su" (hostname=?, addr=?, terminal=pts/2 res=success)'
  • Is this behaviour expected? Is there any vulnerability in su or sudo?

Environment

  • Red Hat Enterprise Linux 4
  • Red Hat Enterprise Linux 5
  • Red Hat Enterprise Linux 6

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content