markusmcnugen / docker-sftp Goto Github PK
View Code? Open in Web Editor NEWFork of atmoz SFTP container built with Ubuntu and includes fail2ban
License: MIT License
Fork of atmoz SFTP container built with Ubuntu and includes fail2ban
License: MIT License
Hi
I was wondering if someone else has had this issue before,
Currently this is my docker compose
sftp:
image: markusmcnugen/sftp
volumes:
- /files:/files
ports:
- "3544:22"
command: user0:xxx:::files
user1:xxxx:1001:100
user2:xxxx:1002:100
and its working with the user0 but the other users can login but cant see the files folder any ideas why?
Thank you
Hey, I'm using this container on Unraid, and for some reason when I choose "Stop" it doesn't just stop the container, but it times out after 1 minute and then an error appears saying "Command execution error".
How could I investigate to see what the problem is?
At some point I have lost the ability to pull this from docker hub, it's the only image I have a problem with.
I see the following message when attempting to start the container.
docker: Error response from daemon: manifest for markusmcnugen/sftp:latest not found: manifest unknown: manifest unknown.
This image contains rsync but does not configure a usable shell for a user to actually use it.
Is this intended?
gangefors/docker-rssh seems to implement this but is horrible outdated.
I tried to add SSH-key to the userkeys folder (in my case /home/docker/sftp/userkeys/foo.pub), but this results in no .ssh-folder is created in the user folder when I run ls -lah
in /home/foo/.
As a temporary solution I did manage to make it work if i mounted a volume in the .ssh/keys folder manually (-v /home/docker/sftp/userkeys/:/home/foo/.ssh/keys/:ro
).
I think the issue is createUser()
with authorized_keys
generation:
Lines 119 to 126 in b6c5765
...is executed before the userkeys folder copy script:
Lines 201 to 218 in b6c5765
If I had the time, I wolud gladly help you out by do a pull request of the issue instead.
The container starts without errors. The fail2ban process starts but cannot execute any bans because it doesn't appear to have permissions to call iptables:
2019-06-15 14:03:07,667 fail2ban.action [171]: ERROR iptables -w -N f2b-sshd
iptables -w -A f2b-sshd -j RETURN
iptables -w -I INPUT -p tcp -m multiport --dports 22 -j f2b-sshd -- stdout: b''
2019-06-15 14:03:07,668 fail2ban.action [171]: ERROR iptables -w -N f2b-sshd
iptables -w -A f2b-sshd -j RETURN
iptables -w -I INPUT -p tcp -m multiport --dports 22 -j f2b-sshd -- stderr: b"iptables v1.6.0: can't initialize iptables
table `filter': Permission denied (you must be root)\nPerhaps iptables or your kernel needs to be upgraded.\niptables v1.6.0: can't initialize iptables table `filter': Permission denied (you must be root)\nPerhaps iptables or your kernel needs to be upgraded.\ngetsockopt failed strangely: Operation not permitted\n"
2019-06-15 14:03:07,668 fail2ban.action [171]: ERROR iptables -w -N f2b-sshd
iptables -w -A f2b-sshd -j RETURN
iptables -w -I INPUT -p tcp -m multiport --dports 22 -j f2b-sshd -- returned 1
2019-06-15 14:03:07,668 fail2ban.actions [171]: ERROR Failed to start jail 'sshd' action 'iptables-multiport': Error starting action
2019-06-15 14:08:51,080 fail2ban.filter [171]: INFO [sshd] Found 123.456.789.123
2019-06-15 14:08:52,053 fail2ban.actions [171]: NOTICE [sshd] Ban 123.456.789.123
2019-06-15 14:08:52,156 fail2ban.action [171]: ERROR iptables -w -n -L INPUT | grep -q 'f2b-sshd[ \t]' -- stdout: b''
2019-06-15 14:08:52,156 fail2ban.action [171]: ERROR iptables -w -n -L INPUT | grep -q 'f2b-sshd[ \t]' -- stderr: b"iptables v1.6.0: can't initialize iptables table `filter': Permission denied (you must be root)\nPerhaps iptables or your kernel needs to be upgraded.\n"
2019-06-15 14:08:52,157 fail2ban.action [171]: ERROR iptables -w -n -L INPUT | grep -q 'f2b-sshd[ \t]' -- returned 1
2019-06-15 14:08:52,157 fail2ban.CommandAction [171]: ERROR Invariant check failed. Trying to restore a sane environment
2019-06-15 14:08:52,259 fail2ban.action [171]: ERROR iptables -w -D INPUT -p tcp -m multiport --dports 22 -j f2b-sshd
iptables -w -F f2b-sshd
iptables -w -X f2b-sshd -- stdout: b''
2019-06-15 14:08:52,259 fail2ban.action [171]: ERROR iptables -w -D INPUT -p tcp -m multiport --dports 22 -j f2b-sshd
iptables -w -F f2b-sshd
iptables -w -X f2b-sshd -- stderr: b"getsockopt failed strangely: Operation not permitted\niptables v1.6.0: can't initialize iptables table `filter': Permission denied (you must be root)\nPerhaps iptables or your kernel needs to be upgraded.\niptables v1.6.0: can't initialize iptables table `filter': Permission denied (you must be root)\nPerhaps iptables or your kernel needs to be upgraded.\n"
(I've redacted the IPs included here)
Any ideas?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.