Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

My attempt to get anonymous access working #152

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,15 @@ certificates won't be persisted and new ones will be generated on each start.
You can also pass `-e "TLS_USE_DSAPRAM=true"` for faster generated certificates
though this option is not recommended for production.

Anonymous access
---------------------
To run with anonymous access, ommit the `FTP_USER_NAME`, `FTP_USER_PASS`, `FTP_USER_HOME` environment variables. The anonymous user will have a directory of `/var/ftp`

You will also need to omit the `-E` switch when runing the container. An example run cmd:
```
CMD /run.sh -c 30 -C 10 -l puredb:/etc/pure-ftpd/pureftpd.pdb -j -R -P 127.0.0.1 -p 30000:30059
```

Credits
-------------
Thanks for the help on stackoverflow with this!
Expand Down
7 changes: 6 additions & 1 deletion run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ then
# Generate the file that will be used to inject in the password prompt stdin
PWD_FILE="$(mktemp)"
echo "$FTP_USER_PASS
$FTP_USER_PASS" > "$PWD_FILE"
$FTP_USER_PASS" > "$PWD_FILE"

# Set uid/gid
PURE_PW_ADD_FLAGS=""
Expand Down Expand Up @@ -95,6 +95,11 @@ $FTP_USER_PASS" > "$PWD_FILE"
fi

rm "$PWD_FILE"
else
useradd -d /var/ftp -s /sbin/nologin ftp
mkdir /var/ftp
chmod 777 /var/ftp
chown -R ftp:ftp /var/ftp
fi

# Set a default value to the env var FTP_PASSIVE_PORTS
Expand Down