首页 > 技术文章 > Linux scp 传文件

iFanLiwei 2020-05-10 20:25 原文

usage: scp [-12346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
           [-l limit] [-o ssh_option] [-P port] [-S program]
           [[user@]host1:]file1 ... [[user@]host2:]file2

远程 -> 本地

# 文件
scp username@servername:/path/filename /localhost/filename
# 目录
scp -r username@servername:/path /localhost

本地 -> 远程

# 文件
scp /localhost/filename username@servername:/path/filename
# 目录
scp -r /localhost username@servername:/path 

推荐阅读