This repository provides a convenient way to remotely connect to Kaggle using Visual Studio Code with password authentication, enabling you to maximize the benefits of Kaggle’s utilities. With this setup, you can maintain a continuous 12-hour session without interruptions. Additionally, you can extend the GPU usage from the default 30 hours per week to 42 hours by following a simple procedure (closing the notebook session at the end of the 29th hour, SSH back in, and maintain it for an additional 12 hours :v). This setup allows for easier usage of the terminal and debugging capabilities compared to the notebook interface provided by Kaggle. Furthermore, you can utilize and manage .py files effortlessly.
✨ Key Features:
📝 How It Works:
The notebook clones this repository and uses bash scripts (install_ssh_server.sh, add_ngrok_token.sh, run_ssh_server.sh) to set up SSH server with password authentication.
And there are many more exciting features for you to explore!
notebook_example.ipynb from this repository2.2 Choose Copy & Edit:

2.3 In the right-hand bar, choose 1 of these 2 GPUs. TPU is not supported:

2.4 At persistence, select Files only to save files every time you Stop Session:

2.4 Go to Ngrok -> Your Authtoken -> press copy:

ssh_password = "kaggle" # Change this to your desired password
# Run bash scripts
!bash install_ssh_server.sh $ssh_password
!bash add_ngrok_token.sh YOUR_NGROK_TOKEN # Replace with your actual token
bash run_ssh_server.sh), notice the HostName: 0.tcp.ap.ngrok.io and Port: 17520. Make a note to use for step 3.6.

3.1 Press Ctrl Shift X, search SSH and install the following 2 extentions:

3.2 Note: How to SSH in detail see here (https://code.visualstudio.com/docs/remote/ssh)
3.3 Press Ctrl Shift P -> Remote-SSH: Connect to Host…

3.4 Press Configure SSH Host…

3.5 Select ~/.ssh/config, usually the first file.

Host Kaggle
HostName 0.tcp.ap.ngrok.io
Port 17520
User root
3.7 Press Ctrl S and Ctrl Shift P -> Remote-SSH: Connect to Host…

3.8 Press Kaggle that you named Host: Kaggle

3.9 When prompted, enter the password you set in step 2.5 (default is kaggle)
3.10 Press continue (Note: If a list appears to select the operating system, please select linux):


4.1 Press Ctrl K O -> Enter the path /kaggle -> Press ok.

4.2 Open terminal press Ctrl J -> enter conda init -> press kill as shown in the picture.

Ctrl J to open terminal):
bash
cd /kaggle/working/remote-ssh-kaggle-vscode
bash install_cuda.sh
Select language and press OK as shown in the picture:
–>
Run the following scripts in terminal to activate cuda (Ctrl J to open terminal):
sudo apt install nvidia-utils-515 -y
4.4 Check GPU nvidia-smi:

Here are some tips and tricks to make the most out of your remote-SSH Kaggle setup:
Data section you will see 2 sections Input and Output:
Input as the place to receive data from kaggle and you do not have the right to edit on visual studio code, the corresponding dir is /kaggle/input/... The maximum storage memory for your private data is ~107GB, and for public data is unlimited.Output is where you will work, corresponding to the dir of /kaggle/working/... Maximum storage memory is ~20GB.

With remote-SSH Kaggle using Visual Studio Code, you can unlock the full potential of Kaggle and enjoy a seamless development experience. Start leveraging the power of Kaggle’s utilities while benefiting.