はじめに
MacのホストOSからVirtualBox上のゲストOSであるLubuntuに対してsftpコマンドを使用してファイル転送をする方法についてChatGPTを用いて尋ね、動作を確認した。
方法
以下のコマンドを実行する。オプションのP
は大文字である点に注意する(ssh接続の時は小文字のp
であった)。
sftp -P 2222 [username of guest OS]@localhost
sftpのプロンプトが出たらputまたはgetでファイルのやり取りをする。
// host OS to guest OS put or // // guest OS to host OS get
Translated with DeepL
Transfer files from the Mac host OS to Lubuntu, the guest OS on VirtualBox, using the sftp command.
Introduction
I asked how to use sftp command to transfer files from Mac host OS to Lubuntu guest OS on VirtualBox using ChatGPT and confirmed that it works.
Method
Execute the following command. Note that the P
option is uppercase (it was lowercase p
for the ssh connection).
sftp -P 2222 [username of guest OS]@localhost
When the sftp prompt appears, use put or get to exchange files.
// host OS to guest OS put or // guest OS to host OS ```` // host OS to guest OS```