Setting up an SFTP server on Linux

leroykayanda

leroykayanda

Posted on January 18, 2024

Setting up an SFTP server on Linux

docker-compose.yaml

version: '3'
services:
 sftp:
   image: atmoz/sftp
   volumes:
     - ./users.conf:/etc/sftp/users.conf:ro
     - ./sftp/uploads/harry:/home/harry
     - ./sftp/uploads/john:/home/john
   ports:
     - "2222:22"
Enter fullscreen mode Exit fullscreen mode

users.conf

harry:secret:::uploads
john:pass:::uploads
Enter fullscreen mode Exit fullscreen mode

An uploads folder will be created in each user directory e.g /home/harry/uploads. Uploads need to be done in this directory as the /home/harry directory is owned by root and the user will not have permissions to upload items there.

References
https://hub.docker.com/r/atmoz/sftp

https://github.com/atmoz/sftp/issues/16

💖 💪 🙅 🚩
leroykayanda
leroykayanda

Posted on January 18, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related