How to SSH into paperspace gradient instance?


(Samuel Wan) #1

Edit: Moving to the beginner category

Hello, after leaving my gradient notebook powered on overnight more than a few times, I wanted to enable the auto-shutdown feature mentioned at https://paperspace.zendesk.com/hc/en-us/articles/115002238947-Auto-Shutdown

However, I just realized I’d never tried to SSH into the instance behind a Gradient notebook before. I thought you just do this:

ssh paperspace@123.123.123.123
(replace 123 with the ip address in the URL of the jupyter notebook)

The instructions for Paperspace instances say that password is emailed to you, but that doesn’t happen when you use a gradient notebook, so I’m not sure where the password comes from. This is such a noob question but I’ve been googling and poking around for 30 minutes. How do I jump through that first hoop?

Thanks,
Sam Wan


#2

Do you still have issue with this?
The easiest way it would be to write to paperspace support.
I have Linux Machine and immediately after creation I got an email from them:


(Samuel Wan) #3

Thanks for your help Walkir. Gradient notebooks on Paperspace are not the same as machine instances on Paperspace. I talked to their support, and they said this:

"Currently you cannot SSH into notebooks, only jobs. If you want to run an autoshutdown script I would advise putting it in your notebook and run that code.

As for CLI user/password that should be your Paperspace credentials."

So, I’ll try the auto-shutdown that way now.


(Samuel Wan) #4

Ok, I’ve given it a good shot but failed at the point where I try to run the script provided by paper space. Here’s the notebook for those who want to give it a shot with a better understanding of linux and Jupyter. I will just have to remember not to leave the lights on. Back to studying lesson 5…


#5

I don’t know if this helps, but even on Gradient, you can access a terminal window through Jupyter. Click on new>Terminal.

I am not sure if this is sufficient in order to setup auto shutdown.


(Mira Ruder-Hook) #6

Hi! Could someone help me with uploading a file from my local computer to my paperspace machine? I looked up how to do it with the scp command, but for some reason it is still not working.

I would really appreciate any help or advice with regards to what I might be doing wrong!

I ssh into my paperspace account from my local computer’s terminal and then I enter this into the terminal:

scp /Users/[my name]/Downloads/[my file].txt paperspace@[IP for paperspace]:/fastai/

Thank you!!


(Samuel Wan) #7

ah, thanks for that tip, Seb


(Samuel Wan) #8

Mirarh, what error message are you getting?


#9

Dunno about gradient and they seem to want you to use their web console for shell sessions in general. You have to buy a public ip address ($3/m) and connect it to your instance to ssh in. I dunno if you can do that with gradient notebooks but I did it with a regular machine. After connecting the ip address, it didn’t work, I rebooted and it still didn’t work, but a couple minutes later it worked. So maybe some routing table had to update someplace after the first failure, or maybe I should have just waited a while, or whatever.

To log in after the ip works, ssh to paperspace@yourip and use the password that they email you. If you’re familiar with linux you might want to set up .ssh/authorized_keys so you don’t have to mess with the password (public/private key login). I ran my usual ansible script that I set up new servers with and it worked fine, even though it’s written for debian and paperspace only has ubuntu.


(Mira Ruder-Hook) #10

Hi @samwan, it says that ‘permission is denied’ or ‘no such file in folder’. I have checked multiple times to confirm that these folders exist and that the file that I want to transfer is in my documents folder. This is what I tried most recently and still getting the same error.

scp Documents/CSV files/[my file] paperspace@[ip of paperspace]:/fastai/Untitled Folder

Thank you for the help!


(Samuel Wan) #11

This might be a silly suggestion if you already know about spaces, but just in case… Since there are spaces in your directory names, the terminal might think they are separate parts of the command. If you add a backslash “\” in front of each space, it will escape the space so the terminal knows the space is part of the directory name.

Try this:
scp Documents/CSV\ files/[my file] paperspace@[ip of paperspace]:/fastai/Untitled\ Folder

Or this (with quotation marks):
scp “Documents/CSV\ files/[my file]” paperspace@[ip of paperspace]:"/fastai/Untitled\ Folder"

I’m getting surgery tomorrow and will be offline for a few weeks, so good luck with this!