0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

SSH経由でファイルをアップロード

Posted at

環境

送信側

图片.png

受信側

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    

图片.png

ディレクトリアップロード

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$ 

图片.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?