Skip to content

Instantly share code, notes, and snippets.

@ha7ilm
Created August 30, 2024 12:58
Show Gist options
  • Save ha7ilm/cded25fa7a0acc3384052688e4c49ebd to your computer and use it in GitHub Desktop.
Save ha7ilm/cded25fa7a0acc3384052688e4c49ebd to your computer and use it in GitHub Desktop.
Install MATLAB through ssh

Install MATLAB through ssh

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment