背景
现在文件的上传或者下载,大家都可以通过一些工具,例如vscode,xftp进行实现。但是有时候,需要使用到scp的情况。这里记录一下使用SCP在跳板服务器中的上传情况。
scp -J [jump-user]@[jump-ip] [target-user]@[target-ip]:[source-file-path] [local-file-path]
在这里值得注意的是,source-file-path如果是文件夹则路径形式是./*,local-file-path会自动创建文件夹。
无跳板传递文件夹
scp -r [local-dir] username@remote_server:[target-dir]
# eg:
scp -r /path/to/local/folder username@remote_server:/path/to/remote/directory
浙公网安备 33010602011771号