This article is a mirror article of machine translation, please click here to jump to the original article.

View: 11570|Reply: 1

Docker builds SFTP services

[Copy link]
Posted on 2021-7-19 16:16:30 | | | |
Because it is too troublesome to set up an sftp service on Linux, I wanted to build a container with sftp service through docker, and I tried to search from the image market and found that there is such an image, the address:The hyperlink login is visible.

Review:

The Linux server is set up with an SFTP service
https://www.itsvse.com/thread-9615-1-1.html

docker command is as follows:

Command explanation: Map the host's port 2222 to the container's port 22, and the host's /data/sftp_dev/upload folder to the container's /home/itsvse/upload folder.



Trying to connect using xftp, I found that the connection was successful, but the file could not be uploaded, and the error was as follows:

Permission is not allowed



Solution

Go to the docker container and run the following command:



I tested uploading files and creating new folders without any issues.
After disconnecting, the test cannot be connected with the following error:

[/entrypoint] Executing sshd
Server listening on 0.0.0.0 port 22.
Server listening on :: port 22.
Accepted password for itsvse from 192.168.1.134 port 15274 ssh2
bad ownership or modes for chroot directory "/home/itsvse"
Accepted password for itsvse from 192.168.1.134 port 15279 ssh2
bad ownership or modes for chroot directory "/home/itsvse"
Accepted password for itsvse from 192.168.1.134 port 15306 ssh2
bad ownership or modes for chroot directory "/home/itsvse"
The solution goes into the container and executes the following command:


(End)





Previous:.NET/C# Load Test NBomber Simple Tutorial
Next:The Linux history command shows the time and the executing user
Posted on 2021-7-19 17:07:31 |
Study, learn, learn, learn, learn
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com