Skip to content

2_BASICS: Accessing PaperSpace using a local terminal through SSH & common Linux commands

jamahun edited this page Jul 28, 2020 · 2 revisions

Pre-requisites

Install a bash emulator on your local computer. If you are using windows I recommend using cmder and for Apple users terminal.

SSH into your virtual machine

The following procedure will allow us to use our local terminal to execute commands on our virtual machine.

  1. Start your PaperSpace virtual machine and copy the public IP address, if you haven't got a public IP you will need to activate it for a small fee.
  2. Inside your local terminal, use: ssh paperspace@<enterpublicIP>.
  3. Enter the password for your PaperSpace virtual machine. The PaperSpace passwords are emailed to you once you activate your virtual machine. If you are not sure what the password is check your email used to setup PaperSpace.
  4. Now we should be connected to the root directory of our virtual machine

Jupyter Notebooks

Follow the steps to access Jupyter Notebooks

  1. In the PaperSpace terminal use jupyter lab --no-browser this should bring up a local host address and a token
  2. Open up another local terminal (either cmder or terminal) and use ssh -NL 8157:localhost:<8888> paperspace@publicIP. You will be prompted to enter your PaperSpace password, once you enter it the terminal should 'hang' meaning it will look like it is trying to execute a command.
  3. Open up a new browser window and enter localhost:8157 into the browser address.
  4. This should bring up Jupyter Lab where you can enter the token from the PaperSpace terminal. Now you should be able to navigate through the directories using Jupyter Lab as well as use terminals, edit code & create Jupyter Notebooks.

Navigating through directories (folders) using the terminal:

  • cd ~ change directory back to home
  • cd directoryName open up directory
  • cd .. navigate to parent directory
  • pwd print working directory
  • ls list folders and files in current directory

Other useful bash commands:

  • exit() cancel operation or use ctrl+c
  • cp filename.filetype newfilename.filetype
  • mv filename.filetype /locationdirectorytomoveto
  • rm filename.filetype Remove a file
  • wget example.url download a file from a URL to the working directory
  • open filename.filetype Open a file
  • cat filename.filetype Read contents of a file
  • ssh IPaddress@IPaddress secure shell
  • nvidia-smi Check graphics performance
  • tab: to complete filename
  • upArrow: cycle through previous commands run

Upgrades and updates

sudo apt-get update
sudo apt-get dist-upgrade