SHIFT

--- Sjoerd Hooft's InFormation Technology ---

User Tools

Site Tools


Sidebar

Recently Changed Pages:

View All Pages


View All Tags


LinkedIn




WIKI Disclaimer: As with most other things on the Internet, the content on this wiki is not supported. It was contributed by me and is published “as is”. It has worked for me, and might work for you.
Also note that any view or statement expressed anywhere on this site are strictly mine and not the opinions or views of my employer.


Pages with comments

View All Comments

sshx11su

SSH X11 forwarding and SU

X authentication is based on cookies, secret little pieces of random data that only you and the X server know. So, when you su the user you su to need to know the cookie. To do so request your cookies and your display setting before you su:

>xauth list
server1.company.local/unix:10  MIT-MAGIC-COOKIE-1  1c64ce9c5e07154d4403bf8b919635f2
server2.company.local/unix:10  MIT-MAGIC-COOKIE-1  0d219bf6b6b4ed805ad51b17f71d2e38
>echo $DISPLAY
localhost:10.0

Now su, and import the cookie configuration and the DISPLAY variable:

>su - oracle
oracle's Password:

>xauth add server2.company.local/unix:10  MIT-MAGIC-COOKIE-1  0d219bf6b6b4ed805ad51b17f71d2e38
>export DISPLAY=localhost:10.0
Note: If you do this on a system with SELinux enabled and run into errors see here
You could leave a comment if you were logged in.
sshx11su.txt · Last modified: 2021/09/24 00:25 (external edit)