配置项
# 配置项
(1)-c
-c
参数用来指定文件拷贝数据传输的加密算法。
$ scp -c blowfish some_file your_username@remotehost.edu:~
1
上面代码指定加密算法为blowfish
。
(2)-C
-C
参数表示是否在传输时压缩文件。
$ scp -c blowfish -C local_file your_username@remotehost.edu:~
1
(3)-F
-F
参数用来指定 ssh_config 文件,供 ssh 使用。
$ scp -F /home/pungki/proxy_ssh_config Label.pdf root@172.20.10.8:/root
1
(4)-i
-i
参数用来指定密钥。
$ scp -vCq -i private_key.pem ~/test.txt root@192.168.1.3:/some/path/test.txt
1
(5)-l
-l
参数用来限制传输数据的带宽速率,单位是 Kbit/sec。对于多人分享的带宽,这个参数可以留出一部分带宽供其他人使用。
$ scp -l 80 yourusername@yourserver:/home/yourusername/* .
1
上面代码中,scp
命令占用的带宽限制为每秒 80K 比特位,即每秒 10K 字节。
(6)-p
-p
参数用来保留修改时间(modification time)、访问时间(access time)、文件状态(mode)等原始文件的信息。
$ scp -p ~/test.txt root@192.168.1.3:/some/path/test.txt
1
(7)-P
-P
参数用来指定远程主机的 SSH 端口。如果远程主机使用默认端口22,可以不用指定,否则需要用-P
参数在命令中指定。
$ scp -P 2222 user@host:directory/SourceFile TargetFile
1
(8)-q
-q
参数用来关闭显示拷贝的进度条。
$ scp -q Label.pdf mrarianto@202.x.x.x:.
1
(9)-r
-r
参数表示是否以递归方式复制目录。
(10)-v
-v
参数用来显示详细的输出。
$ scp -v ~/test.txt root@192.168.1.3:/root/help2356.txt
1
上次更新: 2023/10/17, 16:39:02 访问次数: 0