{"id":19119086,"url":"https://github.com/zeusssz/drater","last_synced_at":"2025-06-17T21:42:53.695Z","repository":{"id":256689416,"uuid":"856135115","full_name":"zeusssz/drateR","owner":"zeusssz","description":"A simple SFTP server implemented in Go","archived":false,"fork":false,"pushed_at":"2025-03-31T14:13:01.000Z","size":28,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T15:42:59.337Z","etag":null,"topics":["go","golang","server","sftp-server"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zeusssz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-09-12T03:46:14.000Z","updated_at":"2025-03-31T14:13:05.000Z","dependencies_parsed_at":"2025-01-03T07:43:07.358Z","dependency_job_id":"aee2ef8c-8f2a-4eff-af60-522ae1236235","html_url":"https://github.com/zeusssz/drateR","commit_stats":null,"previous_names":["zeusssz/drater"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zeusssz/drateR","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeusssz%2FdrateR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeusssz%2FdrateR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeusssz%2FdrateR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeusssz%2FdrateR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zeusssz","download_url":"https://codeload.github.com/zeusssz/drateR/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeusssz%2FdrateR/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260445454,"owners_count":23010385,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["go","golang","server","sftp-server"],"created_at":"2024-11-09T05:08:28.658Z","updated_at":"2025-06-17T21:42:48.681Z","avatar_url":"https://github.com/zeusssz.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# drateR-go\n\n**drateR** is a simple SFTP (Secure File Transfer Protocol) server implemented in Go. It provides a secure way to upload and download files using the SFTP protocol over SSH.\n\n## Features\n\n- **Secure File Transfers**: Utilizes SSH for encrypted file transfers.\n- **Basic Authentication**: Uses a plain text password stored in an environment variable for authentication.\n- **Customizable Directory**: Configurable directory for storing uploaded files.\n\n## Prerequisites\n\n- Go 1.16 or higher\n- SSH private key for authentication\n- Environment variables for configuration\n\n## Directory Structure\n\n```\nsrc/\n│\n├── drateR.go\n└── files/\n```\n\n- **`drateR.go`**: The main Go script for running the SFTP server.\n- **`files/`**: Directory where uploaded files will be stored.\n---\n## Download\n  First, clone the repository to your local machine:\n\n```sh\ngit clone https://github.com/zeusssz/drateR.git\ncd drateR/src\n```\n\n\n## Setup\n\n###\n\n### 1. Install Go Packages\n\nMake sure you have the required Go packages installed:\n\n```sh\ngo get github.com/pkg/sftp\ngo get golang.org/x/crypto/ssh\n```\n\n### 2. Generate SSH Key Pair\n\nGenerate an SSH key pair if you don't already have one:\n\n```sh\nssh-keygen -t rsa -b 2048 -f id_rsa -N \"\"\n```\n\n- **`id_rsa`**: Your private key.\n- **`id_rsa.pub`**: Your public key (not needed in this script but required for SSH setup).\n\n### 3. Set Up Environment Variables\n\nSet the `SFTP_PASSWORD` environment variable with your chosen password:\n\n```sh\nexport SFTP_PASSWORD=\"your_password\"\n```\n\n### 4. Configure Private Key Path\n\nEnsure the `privateKeyPath` constant in `drateR.go` is set to the path of your private key:\n\n```go\nprivateKeyPath = \"id_rsa\" // Path to the private key for authentication\n```\n\n### 5. Run the Server\n\nNavigate to the `src` directory and run the server:\n\n```sh\ncd src\ngo run drateR.go\n```\n\nThe server will start listening on port `2022` by default.\n\n## Usage\n\n### Connecting to the Server\n\nYou can connect to the SFTP server using any SFTP client. Here are a few examples:\n\n#### Using Command Line\n\n```sh\nsftp -P 2022 user@\u003cIP_ADDRESS_OF_SERVER\u003e\n```\n\nReplace `\u003cIP_ADDRESS_OF_SERVER\u003e` with the IP address of the machine running the SFTP server. Use the password you set in the `SFTP_PASSWORD` environment variable when prompted.\n\n#### Using PuTTY’s `psftp` (Windows)\n\n1. Download PuTTY from [PuTTY Download Page](https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html).\n2. Open `psftp` and connect:\n\n   ```sh\n   psftp -P 2022 user@\u003cIP_ADDRESS_OF_SERVER\u003e\n   ```\n\n3. Enter the password when prompted.\n\n## Configuration\n\n- **Port**: The server listens on port `2022` by default. Modify the `port` constant in `drateR.go` to change this.\n- **Root Directory**: The directory where files are stored is specified by `rootDir`. Change it if needed.\n\n## Troubleshooting\n\n- **Failed to Connect**: Ensure that the server is running and the port is open. Verify the private key path and permissions.\n- **Authentication Issues**: Double-check the environment variable `SFTP_PASSWORD` for correct password value and spelling.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeusssz%2Fdrater","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzeusssz%2Fdrater","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeusssz%2Fdrater/lists"}