Skip to content

A basic SFTP setup to get started hosting SFTP locally.

Notifications You must be signed in to change notification settings

ryanslatten/sftp-basic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SFTP Test Server

A ready-to-go SFTP server in Docker.

Quick Start

./setup.sh # To generate keys and data directory
docker compose up -d

That's it. Connect with:

Setting Value
Host localhost
Port 2222
Username testuser
Password testpass
Upload dir /home/testuser/upload (mapped to ./data/ on host)

Test it

sftp -i ./keys/testuser -oPort=2222 testuser@localhost

Configuration

Edit .env to change defaults:

SFTP_USER=testuser
SFTP_PASS=testpass
SFTP_PORT=2222

Then restart: docker compose up -d

Regenerate Keys

rm -rf keys/
./setup.sh
ssh-keygen -R "[localhost]:2222"  # Clear old host key from known_hosts
docker compose up -d

Stop / Clean Up

# Stop the server
docker compose down

docker compose down -v
rm -rf keys/ data/
ssh-keygen -R "[localhost]:2222"
./setup.sh

About

A basic SFTP setup to get started hosting SFTP locally.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages