It would be helpful to show the complete sequence of commands you use to initiate the connection and start MATLAB, along with any error messages. For example:
# batch mode
client$ ssh -v -x user@server # small "x" disables X11 forwarding
server$ unset DISPLAY
server$ nohup matlab -nodesktop -nodisplay -noFigureWindows -nosplash \
-r "ver; quit;" > m_output.out 2>&1 < /dev/null &
# interactive mode
client$ export DISPLAY=localhost:0.0
client$ ssh -v -X user@server # enable X11 forwarding
server$ matlab
A few ideas:
turn on more verbose output (ssh -vv
), and investigate the reason the SSH connection was closed (debug output messages or any log files)
are you directly running a command from ssh
, or is this done in two steps (connect using ssh
, then interactively start command from allocated shell)?
If I understood correctly, this also happens when not using X11 forwarding?
does this happen when using nohup or screen/tmux as well? See this
try adding TCPKeepAlive
to your ssh config
how about using auto-reconnect SSH connections
are you using any custom SSH configurations? (if so show the relevant parts from ssh_config
and sshd_config
files)
try running another process in the background before starting MATLAB
It's been reported before that MATLAB can sometimes mess up the bash shell when it returns. MathWorks recommended using a different shell instead (like tcsh or zsh).