{"id":46802005,"url":"https://github.com/bhdai/kagglelink","last_synced_at":"2026-03-10T06:03:20.596Z","repository":{"id":241147481,"uuid":"804363630","full_name":"bhdai/kagglelink","owner":"bhdai","description":"a way to SSH into Kaggle!","archived":false,"fork":false,"pushed_at":"2025-12-11T18:00:59.000Z","size":677,"stargazers_count":79,"open_issues_count":1,"forks_count":20,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-11T21:37:23.600Z","etag":null,"topics":["kaggle","kaggle-solution","kaggle-vscode","ngrok","remote-ssh","zrok"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bhdai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-05-22T13:03:25.000Z","updated_at":"2025-12-11T12:39:08.000Z","dependencies_parsed_at":"2024-05-22T17:44:33.675Z","dependency_job_id":"5baa912a-6f00-4c65-bbdd-bdbbdb521f3a","html_url":"https://github.com/bhdai/kagglelink","commit_stats":null,"previous_names":["buidai123/kaggle_vscode_remote_ssh","bhdai/kagglelink"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/bhdai/kagglelink","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhdai%2Fkagglelink","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhdai%2Fkagglelink/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhdai%2Fkagglelink/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhdai%2Fkagglelink/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bhdai","download_url":"https://codeload.github.com/bhdai/kagglelink/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bhdai%2Fkagglelink/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30326878,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T05:25:20.737Z","status":"ssl_error","status_checked_at":"2026-03-10T05:25:17.430Z","response_time":106,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["kaggle","kaggle-solution","kaggle-vscode","ngrok","remote-ssh","zrok"],"created_at":"2026-03-10T06:03:14.362Z","updated_at":"2026-03-10T06:03:20.588Z","avatar_url":"https://github.com/bhdai.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kagglelink\n\nA streamlined solution for accessing Kaggle computational resources via SSH and VS Code, powered by Zrok for secure tunneling.\n\n## Overview\n\nKaggleLink allows you to connect to Kaggle environments via SSH, enabling you to leverage Kaggle's computational resources\n\n![](https://github.com/user-attachments/assets/db4454ff-5545-4094-adeb-47b74ab0c33a)\n\n## Getting Started\n\n### Requirements\n\nTo use KaggleLink, you need:\n\n1.  **Zrok Token**: A Zrok token is essential for establishing the secure tunnel. Create an account at [myZrok.io](https://myzrok.io/) to obtain your token. Ensure your account is on the **Starter plan** to utilize NetFoundry's public Zrok instance, which offers 2 environment connections (one for your local machine, one for the Kaggle instance).\n2.  **Public SSH Key**: Your public SSH key needs to be accessible via a URL, either from a GitHub repository or another public file hosting service.\n\n### Quick Setup (on Kaggle)\n\nExecute the following one-line command in a Kaggle notebook cell. This script will set up Zrok and SSH on your Kaggle instance.\n\n```bash\n!curl -sS https://bhdai.github.io/setup | bash -s -- -k \u003cpublic_key_url\u003e -t \u003czrok_token\u003e\n```\n\n\u003e [!NOTE]\n\u003e Replace `\u003cpublic_key_url\u003e` with the URL of your public SSH key file and `\u003czrok_token\u003e` with your Zrok token.\n\nWait for the setup to complete. You should see output similar to this upon successful configuration:\n\n![](https://github.com/user-attachments/assets/22f564f3-8622-4c6c-bb82-9c9c63dd322a)\n\n\u003e [!TIP]\n\u003e **Avoiding Session Timeouts**: Kaggle's interactive notebook sessions have idle timeouts. For long-running remote development, use the **\"Save \u0026 Run All\"** feature by clicking the **Save Version** button (top right) and selecting \"Save\". This runs your notebook as a background job, avoiding timeout interruptions. You can still get the zrok share token from the log screen(click active event at bottom left -\u003e Open Logs in Viewer)\n\n#### How to set up your public SSH key?\n\n1.  **Generate an SSH key pair** on your local machine (if you haven't already). Use a descriptive filename, for example:\n\n    ```bash\n    ssh-keygen -t rsa -b 4096 -C \"kaggle_remote_ssh\" -f ~/.ssh/kaggle_rsa\n    ```\n\n2.  **Upload your public key** (`~/.ssh/kaggle_rsa.pub`) to a public GitHub repository or a similar public file hosting service.\n3.  **Obtain the Raw URL**: Navigate to your uploaded public key file in your repository and click the \"Raw\" button.\n\n    ![](https://private-user-images.githubusercontent.com/140616004/444039100-ec9a884c-1c97-4be6-bd6d-03ac5dd16de7.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NjU0NjQyMzMsIm5iZiI6MTc2NTQ2MzkzMywicGF0aCI6Ii8xNDA2MTYwMDQvNDQ0MDM5MTAwLWVjOWE4ODRjLTFjOTctNGJlNi1iZDZkLTAzYWM1ZGQxNmRlNy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUxMjExJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MTIxMVQxNDM4NTNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT04YjZiY2M1OWRiMDUzYWZiMDUwODUzMjg2NDA4ZTU5NDAxZTM3YWU3ZGJmMDRlMjFiZjA0YmFmOGJlNTJmNzg1JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.wDGsBk1CyVVAWFLSGh8wRldUbz2hiAOzw6t3Zf39K5A)\n\n    Copy the URL from your browser's address bar. It typically looks like `https://raw.githubusercontent.com/\u003cusername\u003e/\u003crepo_name\u003e/refs/heads/main/\u003cfile_path\u003e`.\n\n#### How to get your Zrok token?\n\n1.  If you don't have one, create your Zrok account at [myZrok.io](https://myzrok.io/).\n2.  Go to the [billing page](https://myzrok.io/billing) and ensure your plan is set to **Starter**.\n3.  Create a new token.\n4.  Visit [https://api-v1.zrok.io](https://api-v1.zrok.io/) to retrieve and manage your Zrok tokens.\n\n### Advanced: Environment Variables\n\nFor automated pipelines or power users, you can configure KaggleLink using environment variables instead of CLI flags.\n\n| Variable | CLI Equivalent | Description |\n|----------|----------------|-------------|\n| `KAGGLELINK_KEYS_URL` | `-k` | URL to your public SSH key |\n| `KAGGLELINK_TOKEN` | `-t` | Your Zrok token |\n\n\u003e [!NOTE]\n\u003e CLI arguments (`-k`, `-t`) always override environment variables if both are present.\n\n#### Setting Environment Variables in Kaggle\n\nThe most secure way to pass these credentials is using **Kaggle Secrets**.\n\n1.  Add your secrets in the Kaggle notebook sidebar (**Add-ons** -\u003e **Secrets**).\n2.  Use the following Python snippet in a cell *before* running the setup script:\n\n```python\nfrom kaggle_secrets import UserSecretsClient\nimport os\n\nuser_secrets = UserSecretsClient()\n\n# Set environment variables from secrets\n# Ensure you have added 'KAGGLELINK_TOKEN' and 'KAGGLELINK_KEYS_URL' (optional) to your secrets\nos.environ['KAGGLELINK_TOKEN'] = user_secrets.get_secret(\"KAGGLELINK_TOKEN\")\n\n# You can also set the URL directly if it's public and not stored as a secret\nos.environ['KAGGLELINK_KEYS_URL'] = \"https://raw.githubusercontent.com/your/repo/main/key.pub\"\n```\n\nOnce the environment variables are set, you can run the setup script without arguments:\n\n```bash\n!curl -sS https://bhdai.github.io/setup | bash\n```\n\n## Usage\n\nAfter completing the Kaggle setup, your Kaggle instance is ready for connection. The script will output a Zrok private token at the end which you'll use to connect from your local machine.\n\n### Client Setup (on your Local Machine)\n\n1.  **Install Zrok locally**: Follow the [official Zrok installation guide](https://docs.zrok.io/docs/guides/install/).\n    For Arch-based distributions, you can use:\n\n    ```bash\n    yay -S zrok-bin\n    ```\n\n2.  **Enable Zrok**: Enable Zrok on your local machine using your personal Zrok token:\n\n    ```bash\n    zrok enable \u003cyour_personal_zrok_token\u003e\n    ```\n\n3.  **Access the private tunnel**: Use the Zrok `private_token` obtained from the Kaggle setup output to establish the connection:\n\n    ```bash\n    zrok access private \u003cthe_private_token_from_kaggle_setup\u003e\n    ```\n\n    This command will open a dashboard in your terminal, displaying your connection details, including a local address like `127.0.0.1:9191`.\n\n### SSH Connection\n\nConnect to your Kaggle instance via SSH using the local address and port provided by Zrok (e.g., `127.0.0.1:9191`).\n\n```bash\nssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i ~/.ssh/kaggle_rsa -p 9191 root@127.0.0.1\n```\n\n\u003e [!NOTE]\n\u003e The port (e.g., 9191) generally remains consistent across sessions, so you typically won't need to adjust it for each new instance.\n\n#### SSH Configuration\n\nTo simplify future connections, add the following configuration to your `~/.ssh/config` file:\n\n```\nHost Kaggle\n    HostName 127.0.0.1\n    UserKnownHostsFile /dev/null\n    StrictHostKeyChecking no\n    IdentityFile ~/.ssh/kaggle_rsa\n    Port 9191\n    User root\n```\n\nWith this configuration, you can simply use `ssh Kaggle` to connect.\n\n### File Transfer with Rsync\n\nTransfer files between your local machine and Kaggle instance using `rsync`:\n\n```bash\n# From local to remote\nrsync -e \"ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i ~/.ssh/kaggle_rsa -p 9191\" \u003cpath_to_local_file\u003e root@127.0.0.1:\u003cremote_destination_path\u003e\n# or if you have you SSH config set up (see above)\nrsync -avz \u003cpath_to_local_file\u003e Kaggle:\u003cremote_destination_path\u003e\n\n# From remote to local\nrsync -e \"ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i ~/.ssh/kaggle_rsa -p 9191\" root@127.0.0.1:\u003cpath_to_remote_file\u003e \u003clocal_destination_path\u003e\n# or if you have you SSH config set up (see above)\nrsync -avz Kaggle:\u003cpath_to_remote_file\u003e \u003clocal_destination_path\u003e\n```\n\n\u003e [!IMPORTANT]\n\u003e The Zrok Starter plan limits you to two environment connections. While the script automatically releases the Kaggle instance's connection upon shutdown, it's good practice to verify your active connections at [https://api-v1.zrok.io/](https://api-v1.zrok.io/) before rerunning the script, ensuring your local machine is the primary active connection.\n\n## Contributing\n\nWe welcome contributions to KaggleLink! If you're interested in improving this project, please follow these steps:\n\n1.  **Fork the repository**.\n2.  **Create a new branch** for your feature or bug fix (`git checkout -b feature/your-feature-name` or `bugfix/issue-description`).\n3.  **Make your changes**, adhering to the existing coding style and standards.\n4.  **Write and run tests** to ensure your changes work as expected and don't introduce regressions.\n5.  **Commit your changes** with clear and concise commit messages.\n6.  **Push your branch** to your forked repository.\n7.  **Open a Pull Request** to the main branch, providing a detailed description of your changes.\n\n## License\n\nThis project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbhdai%2Fkagglelink","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbhdai%2Fkagglelink","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbhdai%2Fkagglelink/lists"}