Difference between revisions of "Connecting to the Lab Computers Remotely"

From AstroBaki
Jump to navigationJump to search
Line 29: Line 29:
 
'''ssh -X <username>@ugastro.berkeley.edu'''
 
'''ssh -X <username>@ugastro.berkeley.edu'''
  
to enable the x window server. This will let you run python and ipython commands that plot and have them displayed on your screen.
+
to enable the x window server. This will let you run python and ipython commands that plot and have them displayed on your screen. To make this process smoother you can run
 +
 
 +
'''ipython --pylab'''
 +
 
 +
which will import *numpy* as *np* and *matplotlib.pyplot* as *plt* or
 +
 
 +
'''ipython --matplotlib'''
 +
 
 +
and then manually import the packages you want.
  
 
=== Changing the port/server ===
 
=== Changing the port/server ===

Revision as of 09:35, 18 January 2021

Remote Connecting

Windows Terminals

If you are using a Windows machine it is strongly recommended you download a UNIX-like terminal. Below are some that are easy to set up.

Git Bash (easiest)

Download Link

Windows Ubuntu Subsystem

Installation & Setup Guide

SSH Commands

To normally connect, run the command ssh <username>@ugastro.berkeley.edu in your terminal. <username> is the username you use to log into the lab computers.

Jupyter Notebook

1) ssh -N -L <PORT>:localhost:<PORT> <username>@ugastro.berkeley.edu where <PORT> is a number between 1024 and 32,767 you choose semi-arbitrarily so it hopefully is not already in use by another student.

2) Leave that terminal alone and open another terminal window and ssh <username>@ugastro.berkeley.edu as you would do normally.

3) In that second terminal run the command jupyter notebook --no-browser --port=<PORT> where you use the same port number as you did in step 1).

4) Now in the web browser of your choice you should be able to access Jupyter Notebook by copy & pasting the url it provides for you in the terminal window.


X window interface

You can also connect to the remote server with the command

ssh -X <username>@ugastro.berkeley.edu

to enable the x window server. This will let you run python and ipython commands that plot and have them displayed on your screen. To make this process smoother you can run

ipython --pylab

which will import *numpy* as *np* and *matplotlib.pyplot* as *plt* or

ipython --matplotlib

and then manually import the packages you want.

Changing the port/server

The default port for ssh connection is port 22. This is a well known fact in the networking world and so often times system administrators will change the ssh port to hinder unwanted probes and increase the network's security. The port can also be used to allow connections to multiple machines. This year there will be two servers running on the network. If your radio astronomy work seems to be taking a while to process you might want to see if someone else is using the server with the command

w

you can also check the resources available with the command

top.

If the server is being used by others then you might want to use the other server. This server can be accessed using an alternative port with the ssh command

ssh -p <port number> <username>@ugastro.berkeley.edu.