X11 forward for su

Last modified 1 year ago
Danger icon
The last modifications of this post were around 1 year ago, some information may be outdated!

Summary

After logging in as a normal user, change to the su account, but don't use
the '-' to preserve display values. Finally, append your users xauth settings
onto your own, which will include the "cookie" for X11 forwarding

Code

sudo su
xauth add $(xauth -f ~[user]/.Xauthority list|tail -1)