Skip to content

Instantly share code, notes, and snippets.

@hsed
Last active December 11, 2023 22:08
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save hsed/197ded8431bb545dffefb742dab5efb8 to your computer and use it in GitHub Desktop.
Save hsed/197ded8431bb545dffefb742dab5efb8 to your computer and use it in GitHub Desktop.
Vast.ai VPN Setup Commands

Commands

Remote => Server/GPU Computer Client => You/Dumb Computer

SSH and tunnel a port

This allows you to later run jupyterlab at 8080 on remote pc and its tunneled so u can view stuff in client.

ssh -p <PORT> <REMOTE_USER>@<REMOTE_IP> -L 8080:localhost:8080

The only way this will work if your public key is actually present on ssh server so you have to remember to set that up, its usally first time only as:

ssh-keygen -t rsa

and you usually keep path and filename as default, only add password if u have to but then keep it safe.

The cat .ssh/id_rsa.pub command can be used to get your public key out for storing on remote server or vastai account settings

Transfer a large file from local->remote using ssh protocol

The first command shuld work, if not present the private ssh key to the server and it should accept it. Also -v flag is useful for debugging

# <REMOTE_DEST_DIR> == /root/
# may add -i ..\.ssh\id_rsa after -v, not necessary
scp -v  -P <PORT> <LOCAL_FILE> root@<REMOTE_IP>:<REMOTE_DEST_DIR>

Run Jupterlab on Server

This command assumes you linked 8080 initially

pip install jupyterlab
jupyter lab --ip=127.0.0.1 --port=8080 --allow-root

Now run the link provided in your client's browser and it should work!

Untar a gz file

tar xvzf file.tar.gz
@ghaznkhan
Copy link

how do you transfer from remote--> local

@gordinmitya
Copy link

how do you transfer from remote--> local

just the same scp, swap remote and local destinations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment