Quickstart¶
This quickstart explains how to login to the server jupiter-imphys.tnw.tudelft.nl
, copy a Matlab script file to the server, start Matlab, run the matlab script and copy the result file from the server.
We have two servers jupiter-imphys.tnw.tudelft.nl
and saturn-imphys.tnw.tudelft.nl
. In the examples these names will be used in full, but in the text the will be referred to by jupiter
and saturn
.
Login to server¶
Both servers (jupiter
and saturn
) can only be accessed via an in-between
server called a proxy server or a bastion server. For students this proxy server is student-linux.tudelft.nl
, for non-students this proxy server is linux-bastion-ex.tudelft.nl
. In the example below we will use linux-bastion-ex
.
- start Windows PowerShell to start a local shell
- start Terminal to start a local shell
-
type
ssh <netid>@linux-bastion-ex.tudelft.nl
in the shell and press EnterIf this is the first time you connect with
ssh
to the proxy serverlinux-bastion-ex
you will be asked to accept the host-key. Answeryes
to accept the key and continue.Warning
You will be asked for your password. Note that you will not see the keystrokes on the screen for privacy and security! If you made a mistake you can type Ctrl+U to empty your input and start over.
Expected output
After entering your netid password you will now see something like this:
____ ____ ___ ___ _ ____ _|___ \|___ \( _ ) / __| '__\ \ / / __) | __) / _ \ \__ \ | \ V / / __/ / __/ (_) | |___/_| \_/ |_____|_____\___/ ===== This server is not meant for storing large files. It's mainly for hopping to another server and storing your ssh keys. Your homedirectory is therefore limited in space. If you store large files on this server anyway we reserve the right to remove them. ===== Last login: <removed> from <removed> [<netid>@srv228 ~]$
Info
- you are logged in to the proxy server
linux-bastion-ex
<netid>
will show your netid,<removed>
is used for privacy- this last line
[<netid>@srv228 ~]$
ending with the dollar sign and followed by a white square is the prompt of the shell. The white square is the cursor where your keyboard input will be written - after the prompt you can enter Linux commands or start a program (like Matlab). More on this later
- you are logged in to the proxy server
-
on the proxy server type
ssh jupiter-imphys.tnw.tudelft.nl
in the shell and press EnterIf this is the first time you connect with
ssh
to the serverjupiter
you will be asked to accept the host-key. Answeryes
to accept the key and continue.Expected output
After entering your netid password you will now see something like this:
Welcome to Ubuntu 24.04 LTS (GNU/Linux 6.8.0-31-generic x86_64) * Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/pro System information as of Thu May 30 01:19:30 PM UTC 2024 System load: 0.0 Usage of /home: 2.0% of 20.96TB Memory usage: 1% Swap usage: 0% Temperature: 55.0 C Processes: 1817 Users logged in: 2 IPv4 address for eno12399np0: 131.180.121.118 * Strictly confined Kubernetes makes edge and IoT secure. Learn how MicroK8s just raised the bar for easy, resilient and secure K8s cluster deployment. https://ubuntu.com/engage/secure-kubernetes-at-the-edge Expanded Security Maintenance for Applications is not enabled. 0 updates can be applied immediately. Enable ESM Apps to receive additional future security updates. See https://ubuntu.com/esm or run: sudo pro status Last login: <removed> from <removed> <netid>@jupiter-imphys:~$
Info
- you are now logged in to the server
jupiter
- note that there is interesting information on this login screen about the conditions of the server
- you are now logged in to the server
-
leave this shell open for later use
Copy the test.m
script to the server¶
Tip
more information about file transport can be found here
Now you have logged in (maybe for the first time) also your homedirectory has been created on the server. Note that this homedirectory is available on both servers! You can now start copying a file from your computer to the server.
This copy also has to be done using the SSH protocol, similar to using ssh
to log in. This time we will combine the log in to proxy server and to the jupiter
in one command.
- start Windows PowerShell to start a local shell
- navigate to the directory with your Matlab script, e.g.:
cd d:\data\test.m
- start Terminal to start a local shell
- navigate to the directory with your Matlab script, e.g.:
cd ~/Developer/test.m
-
with
test.m
in your shell’s current directory type:scp -o ProxyJump=<netid>@linux-bastion-ex.tudelft.nl test.m <netid>@jupiter-imphys.tnw.tudelft.nl:.
If this is the first time you connect with
scp
to the serverjupiter
you will be asked to accept the host-key. Answeryes
to accept the key and continue. NOTE: on some shells you will not see the typed characters on the screen!Info
- you have now copied
test.m
from your computer to your homedirectory on the server - read more information on the command here
- you have now copied
-
check if the file is copied by entering the shell you’ve opened before and typing
ls ~
. You will see something like this:<netid>@jupiter-imphys:~$ ls ~ test.m <netid>@jupiter-imphys:~$
Start Matlab¶
For some major programs multiple versions are installed. To use the right version use the module
system. This system will set the right environment for the version you want to use. We will now use the default version of Matlab (R2021b):
-
again enter your shell you’ve opened before and type:
module load matlab
Info
- you have now setup your shell for Matlab version R2021b
- if you do not specify a version after the module name like
module load matlab/R2023b
the default version will be set. In this case this isR2021b
- to see which modules are available type
module avail
- you need to do this only once for the shell you’ve started with
ssh
. If the shell is closed and opened again you will need to load the module again.
-
start Matlab with
matlab -nodisplay
Explanation command
- because the default
matlab
module has been chosen, thismatlab
will be found here:/opt/apps/MATLAB/R2021b/bin/matlab
- the
-nodisplay
option tells Matlab not to use the graphic system
Expected output
You will now see something like this:
rligteringen@jupiter-imphys:~$ matlab -nodisplay < M A T L A B (R) > Copyright 1984-2021 The MathWorks, Inc. R2021b Update 7 (9.11.0.2358333) 64-bit (glnxa64) August 16, 2023 To get started, type doc. For product information, visit www.mathworks.com. >>
Info
- note the version in the header information
- the prompt of Matlab is
>>
followed by the cursor a white square - after the prompt you can type Matlab commands
- because the default
Run the test.m
script in Matlab¶
-
at the matlab prompt type:
run('test.m') exit
Info
run
runs the script given as a parameter, in this case the filetest.m
exit
closes matlab
Copy the file test.mat
from the server¶
This is very similar to copying the files to the server from your computer.
- start a new shell on your computer not on the server
- in this shell go to the directory where you want to store the
test.mat
from the server -
enter this command:
scp -o ProxyJump=<netid>@linux-bastion-ex.tudelft.nl <netid>@jupiter-imphys.tnw.tudelft.nl:test.mat .
Info
- the file
test.mat
is now copied from the server to your computer - note that the proxy server is used
- the file
You can now inspect the results from running your Matlab script on the server with your computer.