{"id":18859704,"url":"https://github.com/meibraransari/sftp-server-docker","last_synced_at":"2026-03-19T06:44:55.169Z","repository":{"id":250819189,"uuid":"835563781","full_name":"meibraransari/sftp-server-docker","owner":"meibraransari","description":"🔐 SFTP with key and password base authentication ","archived":false,"fork":false,"pushed_at":"2024-11-02T14:20:42.000Z","size":114,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-30T20:15:18.904Z","etag":null,"topics":["sftp","sftp-access","sftp-client","sftp-deploy","sftp-download","sftp-server","sftp-upload","sftp-user"],"latest_commit_sha":null,"homepage":"","language":null,"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/meibraransari.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-07-30T05:14:14.000Z","updated_at":"2024-11-02T14:20:46.000Z","dependencies_parsed_at":"2024-11-01T18:21:43.567Z","dependency_job_id":"e6b26e8b-9ef1-4877-a7f8-09514ce035ad","html_url":"https://github.com/meibraransari/sftp-server-docker","commit_stats":null,"previous_names":["meibraransari/sftp-server-docker"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meibraransari%2Fsftp-server-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meibraransari%2Fsftp-server-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meibraransari%2Fsftp-server-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meibraransari%2Fsftp-server-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/meibraransari","download_url":"https://codeload.github.com/meibraransari/sftp-server-docker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239800488,"owners_count":19699127,"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":["sftp","sftp-access","sftp-client","sftp-deploy","sftp-download","sftp-server","sftp-upload","sftp-user"],"created_at":"2024-11-08T04:18:57.853Z","updated_at":"2026-02-04T02:05:39.767Z","avatar_url":"https://github.com/meibraransari.png","language":null,"readme":"---\nCreated: 2024-07-27T14:01:27+05:30\nUpdated: 2024-11-02T19:47:44+05:30\nMaintainer: Ibrar Ansari\n---\n\u003ch1 align=\"center\"\u003e\n  📢📢📢 Attention all Docker 🐳 Beginners \u0026 Professionals! 🎯\n\u003c/h1\u003e\n\n\u003cp align=\"left\"\u003e  \n    \u003ca href=\"https://hub.docker.com/r/ibraransaridocker/sftp-server-docker\"\u003e\n        \u003cimg alt=\"SFTP Server Docker\" src=\"https://img.shields.io/docker/pulls/ibraransaridocker/sftp-server-docker\" /\u003e\n    \u003c/a\u003e    \n\u003c/p\u003e\n\n# 💻 Unlock the power of SFTP with this Ubuntu image, perfect for testing and development! 🛠️\n\n## 🚨 Please note: This image is designed for educational and testing purposes 📚 🧪 ONLY! It is NOT SUITABLE for production environments! 🚫\n\nThis Docker image is built on Ubuntu 22.04 and comes pre-installed with an SSH server, enabling seamless creation of SSH/SFTP-accessible containers. You can effortlessly configure access using SSH keys or by utilizing a default username and password.\n\n## 🎬 Video Demonstration\n[![Watch on Youtube](https://i.ytimg.com/vi_webp/P6ialwyqIJg/maxresdefault.webp)](https://youtu.be/P6ialwyqIJg?si=kJFAEoxPH_dwn46A)\n\n## Step 1: Create Authentication SSH-Keygen Keys.\n```\nssh-keygen -t rsa -f ~/.ssh/sftp_id_rsa_key -b 4096 -C \"This is used for sftp\" -N \"\"\nls -alsh ~/.ssh/\n```\n## Step 2: Pull docker image\n```\ndocker pull ibraransaridocker/sftp-server-docker:latest\n```\n## Step 3: Set variables to run the docker container.\n### Change 👇 variables(containername, username, password \u0026 port) according to your need.\n```\ncontainer_name=sftp_server_1\nsftp_user=ibrar_ansari\nsftp_pass=your_secure_password\nsftp_port=2023\ncontainer_image=ibraransaridocker/sftp-server-docker:latest\nkey_path=~/.ssh/sftp_id_rsa_key.pub\nmount_path=/ansari\n```\n## Step 4: Run docker container.\n```\ndocker run -itd --name=$container_name -p $sftp_port:22 -e SSH_USERNAME=$sftp_user -e PASSWORD=$sftp_pass -e AUTHORIZED_KEYS=\"$(cat $key_path)\" -v $mount_path:/home/$ssh_user/$mount_path $container_image\n```\n\u003e Note:- Mounted path will be available under /home/{your_user}/mount_path.\n\n## Step 5: Test SSH connection \n### Get Node IP:\n```\nhostname=$(hostname -I | awk '{print $1}')\n```\n\n### Pem Key Method:\n```\nssh -i ~/.ssh/sftp_id_rsa_key -p $sftp_port $sftp_user@$hostname\n```\n### Password Method:\n```\nssh -p $sftp_port $sftp_user@$hostname\n```\n\n## Step 6: Test SFTP Connection \n### Test SFTP connection with password method:\n```\nsftp \u003cSFTP_USER\u003e@\u003cHOST_IP\u003e -P \u003cPORT\u003e\n```\n### Test SFTP connection with key method:\n```\nsftp -P \u003cPORT\u003e -i \u003cPRIVATE_KEY_PATH\u003e \u003cSFTP_USER\u003e@\u003cHOST_IP\u003e \n```\n###  # If the -i option is not available, you can use the -o option with a syntax like::\n```\nsftp -P \u003cPORT\u003e -oIdentityFile=\u003cPRIVATE_KEY_PATH\u003e \u003cSFTP_USER\u003e@\u003cHOST_IP\u003e \n```\n### Connection file method:\n```\n# Create file and assign private key to connect sftp\nnano ~/.ssh/config.sftp\nHost work\n\tHost \u003cHOST_IP\u003e\n\tUser \u003cSFTP_USER\u003e\n\tIdentityFile \u003cPRIVATE_KEY_PATH\u003e\n\tAddKeysToAgent yes\n\tPort \u003cPORT\u003e\n\n# Connect it\nsftp -F \u003cPRIVATE_KEY_PATH\u003e \u003cHOST_IP\u003e\n```\n\n### Using FileZilla\n```\nHost: sftp://\u003cYour_Host_IP\u003e\nUsername: Value of sftp_user variable.\nPassword: Value of sftp_pass variable. \nPort: Value of sftp_port variable. \n\nNote:- Mounted path will be available under /home/{your_user}/mount_path.\n```\n\n### 💼 Connect with me 👇👇 😊\n\n- 🔥 [**Youtube**](https://www.youtube.com/@DevOpsinAction?sub_confirmation=1)\n- ✍ [**Blog**](https://ibraransari.blogspot.com/)\n- 💼 [**LinkedIn**](https://www.linkedin.com/in/ansariibrar/)\n- 👨‍💻 [**Github**](https://github.com/meibraransari?tab=repositories)\n- 💬 [**Telegram**](https://t.me/DevOpsinActionTelegram)\n- 🐳 [**Docker**](https://hub.docker.com/u/ibraransaridocker)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeibraransari%2Fsftp-server-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeibraransari%2Fsftp-server-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeibraransari%2Fsftp-server-docker/lists"}