For: Ubuntu 20.04.6 LTS + MATLAB R2024a
ssh -X you@yourserver
#If doesn't exist:
touch ~/.Xauthority
sudo -s
touch /root/.Xauthority
exit
#Make root work with X11 forwarding:
sudo xauth add $(xauth -f ~/.Xauthority list|tail -1)
#This trick is from here: https://blog.mobatek.net/post/how-to-keep-X11-display-after-su-or-sudo/
#Go to MATLAB install directory:
sudo -H ./install
Activation needed to be done also as sudo matlab
, otherwise it just hanged forever.
Afterwards, I could use matlab
from my own account (without sudo
).