【发布时间】:2021-07-20 18:17:07
【问题描述】:
https://github.com/atmoz/sftp 我正在尝试对此进行设置以进行测试,并且我尝试按照自述文件进行操作,但没有运气。我需要使用 ssh 密钥登录,但有指示,但它一直要求我输入密码。生成密钥时我没有设置密码。
/home/test/sftp_testing
$ ls
test1.txt test2.txt test3.txt testing4.txt
$ ssh-keygen -t ed25519 -f ssh_host_ed25519_key < /dev/null
$ ssh-keygen -t rsa -b 4096 -f ssh_host_rsa_key < /dev/null
$ ls
ssh_host_ed25519_key ssh_host_ed25519_key.pub ssh_host_rsa_key ssh_host_rsa_key.pub test1.txt test2.txt test3.txt testing4.txt
$ docker run \
> -v /home/test/sftp_testing/ssh_host_ed25519_key:/etc/ssh/ssh_host_ed25519_key \
> -v /home/test/sftp_testing/ssh_host_rsa_key:/etc/ssh/ssh_host_rsa_key \
> -v /home/test/sftp_testing/share:/home/foo/share \
> -p 9000:22 -d atmoz/sftp \
> foo::1001
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
7e10e9d5a864 atmoz/sftp "/entrypoint foo::10…" 4 seconds ago Up 3 seconds 0.0.0.0:9000->22/tcp, :::9000->22/tcp priceless_edison
$ sftp -P 9000 -i /home/test/sftp_testing/ssh_host_rsa_key -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null foo@10.0.2.15
Warning: Permanently added '[10.0.2.15]:9000' (ED25519) to the list of known hosts.
foo@10.0.2.15`'s password:
【问题讨论】:
标签: bash docker containers sftp