How can I use X11 forwarding for sudo users that are connected via ssh ?
Issue
export DISPLAY => Error: Can't open display:
- X11 forwarding works fine for the user that connects to a remote system via
ssh
, but it fails after the user context has been changed withsudo
Environment
- Red Hat Enterprise Linux 6
- Red Hat Enterprise Linux 7
- Red Hat Enterprise Linux 8
- Red Hat Enterprise Linux 9
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.