環境
送信側
受信側
QEMU仮想環境 UbuntuServer
UbuntuServerの環境はこちらの記事を参照
https://qiita.com/earthen94/items/a2c952bb6bb45d1a7775
サーバー起動
qemu-system-x86_64 \
-enable-kvm \
-m 2048 \
-cpu host \
-smp 2 \
-drive file=ubuntu-server.qcow2,format=qcow2 \
-net nic \
-net user,hostfwd=tcp::2222-:22,hostfwd=tcp::8080-:80,hostfwd=tcp::3000-:3000
ファイルアップロード
test@test-ThinkPad-X280:~/test$ touch test.bin
test@test-ThinkPad-X280:~/test$ ls
test.bin
test@test-ThinkPad-X280:~/test$ scp -P 2222 test.bin testuser@localhost:/home/testuser/
testuser@localhost's password:
test.bin 100% 0 0.0KB/s 00:00
ディレクトリアップロード
test@test-ThinkPad-X280:~/test$ ls test/
test1.bin test2.bin
test@test-ThinkPad-X280:~/test$ scp -P 2222 -r test testuser@localhost:/home/testuser/
testuser@localhost's password:
test2.bin 100% 0 0.0KB/s 00:00
test1.bin 100% 0 0.0KB/s 00:00
test@test-ThinkPad-X280:~/test$