0
0
Fork 0
mirror of https://github.com/atmoz/sftp.git synced 2024-11-24 12:59:24 -05:00

allow adding user to existing container

This commit is contained in:
Yann-Cyril PELUD 2017-02-17 15:31:21 +01:00
parent 06eafb8e1f
commit f9df2c4b70
2 changed files with 23 additions and 0 deletions

View file

@ -148,6 +148,19 @@ bindmount /data/common /home/peter/common
bindmount /data/docs /home/peter/docs --read-only
```
# Add user to you container
You can add users to your running container like this:
with docker
```
docker exec <container_id> /entrypoint --adduser bar:abc:1004:100:incomming
```
with docker-compose
```
docker-compose exec sftp /entrypoint --adduser baz:xyz:1003:100
```
# What's the difference between Debian and Alpine?
The biggest differences are in size and OpenSSH version.

View file

@ -96,6 +96,16 @@ if [ "$1" == "--readme" ]; then
exit 0
fi
# Add user to an existing container (with docker exec )
if [ "$1" == "--adduser" ]; then
shift
for user in "$@"; do
echo "$user" >> "$userConfFinalPath"
createUser "$user"
done
exit 0
fi
# Create users only on first run
if [ ! -f "$userConfFinalPath" ]; then