1. 语法
    1. scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
    2. [-l limit] [-o ssh_option] [-P port] [-S program]
    3. [[user@]host1:]file1 [...] [[user@]host2:]file2
    1. 服务器单个文件下载到本地
    1. scp {user}@{ip}:{path/filename} {localPath}

    例如:
    将120.120.23.123IP地址下的/etc/nginx路径下的nginx.conf 文件下载到本地的/User目录下

    1. scp root@120.120.23.123:/etc/nginx/nginx.conf /User
    1. 服务器下载文件夹到本地 例如:将nginx文件夹下载到本地

      1. scp -r root@120.120.23.123:/etc/nginx /User
    2. 上传文件

      1. scp /User/test.txt root@120.120.23.123:/root
    3. 上传文件夹

    1. scp -r /User/testFile root@120.120.23.123:/root

    另外: 如果修改了ssh默认端口为10000,则在scp后面加 “-P 端口号” 命令

    1. scp -P 10000 root@120.120.23.123:/etc/nginx/nginx.conf /User