文档介绍:该【Linux scp命令怎么使用 】是由【mama1】上传分享,文档一共【14】页,该文档可以免费在线阅读,需要了解更多关于【Linux scp命令怎么使用 】的内容,可以使用淘豆网的站内搜索功能,选择自己适合的文档,以下文字是截取该文章内的部分文字,如需要获得完整电子版,请下载此文档到您的设备,方便您编辑和打印。Linuxscp命令怎么使用
Linux系统中scp吩咐的具体说明篇一
1、吩咐格式:
scp[参数][原路径][目标路径]
2、吩咐功能:
scp是securecopy的缩写,scp是linux系统下基于ssh登陆进行平安的远程文件拷贝吩咐。linux的scp吩咐可以在linux服务器之间复制文件和书目。
Linux系统中scp吩咐参数说明篇二
-1强制scp吩咐运用协议ssh1
-2强制scp吩咐运用协议ssh2
-4强制scp吩咐只运用IPv4寻址
-6强制scp吩咐只运用IPv6寻址
-B运用批处理模式(传输过程中不询问传输口令或短语)
-C允许压缩。(将-C标记传递给ssh,从而打开压缩功能)
-p保留原文件的修改时间,访问时间和访问权限。
-q不显示传输进度条。
-r递归复制整个书目。
-v具体方式显示输出。scp和ssh(1)会显示出整个过程的调试信息。这些信息用于调试连接,验证和配置问题。
-ccipher以cipher将数据传输进行加密,这个选项将干脆传递给ssh。
-Fssh_config指定一个替代的ssh配置文件,此参数干脆传递给ssh。
-iidentity_file从指定文件中读取传输时运用的密钥文件,此参数干脆传递给ssh。
-llimit限定用户所能运用的带宽,以Kbit/s为单位。
-ossh_option假如习惯于运用ssh_config(5)中的参数传递方式,
-Pport留意是大写的P,port是指定数据传输用到的端口号
-Sprogram指定加密传输时所运用的程序。此程序必需能够理解ssh(1)的选项。
.运用实例:篇三
scp吩咐的实际应用概述:
从本地服务器复制到远程服务器:
(1)复制文件:
吩咐格式:
代码如下:
scplocal_file《ahref=“mailto:remote_******@remote_ip:remote_folder”》remote_******@remote_ip:remote_folder《/a》
或者
scplocal_file《ahref=“mailto:remote_******@remote_ip:remote_file”》remote_******@remote_ip:remote_file《/a》
或者
scplocal_fileremote_ip:remote_folder
或者
scplocal_fileremote_ip:remote_file
第1,2个指定了用户名,吩咐执行后须要输入用户密码,第1个仅指定了远程的书目,文件名字不变,第2个指定了文件名
第3,4个没有指定用户名,吩咐执行后须要输入用户名和密码,第3个仅指定了远程的书目,文件名字不变,第4个指定了文件名
(2)复制书目:
吩咐格式:
scp-rlocal_folderremote_******@remote_ip:remote_folder
或者
scp-rlocal_folderremote_ip:remote_folder
第1个指定了用户名,吩咐执行后须要输入用户密码;
第2个没有指定用户名,吩咐执行后须要输入用户名和密码;
从远程服务器复制到本地服务器:
从远程复制到本地的scp吩咐与上面的吩咐雷同,只要将从本地复制到远程的吩咐后面2个参数互换依次就行了。
.吩咐功能:篇四
scp是securecopy的缩写,scp是linux系统下基于ssh登陆进行平安的远程文件拷贝吩咐。linux的scp吩咐可以在linux服务器之间复制文件和书目。
Linux系统中scp吩咐运用实例篇五
scp吩咐的实际应用概述:
从本地服务器复制到远程服务器:
(1)复制文件:
吩咐格式:
复制代码代码如下:
scplocal_file<ahref="mailto:remote_******@remote_ip:remote_folder">remote_******@remote_ip:remote_folder</a>
或者
scplocal_file<ahref="mailto:remote_******@remote_ip:remote_file">remote_******@remote_ip:remote_file</a>
或者
scplocal_fileremote_ip:remote_folder
或者
scplocal_fileremote_ip:remote_file
第1,2个指定了用户名,吩咐执行后须要输入用户密码,第1个仅指定了远程的书目,文件名字不变,第2个指定了文件名
第3,4个没有指定用户名,吩咐执行后须要输入用户名和密码,第3个仅指定了远程的书目,文件名字不变,第4个指定了文件名
(2)复制书目:
吩咐格式:
scp-rlocal_folderremote_******@remote_ip:remote_folder
或者
scp-rlocal_folderremote_ip:remote_folder
第1个指定了用户名,吩咐执行后须要输入用户密码;
第2个没有指定用户名,吩咐执行后须要输入用户名和密码;
从远程服务器复制到本地服务器:
从远程复制到本地的scp吩咐与上面的吩咐雷同,只要将从本地复制到远程的吩咐后面2个参数互换依次就行了。
实例1:从远处复制文件到本地书目
吩咐:******@:/opt/soft/nginx-/
输出:
复制代码代码如下:
[******@localhost~]#cd/opt/soft/
[******@localhostsoft]#ll
总计80072
drwxr-xr-x12rootroot409609-2118:
drwxr-xr-x3rootroot409609-2117:
drwxr-xr-x10rootroot409610-3017:
drwxr-xr-x10rootroot409609-1719:
-rwxr-xr-x1rootroot8**********-12-21jdk-6u16-linux-
drwxrwxrwx2rootroot409609-2101:16mysql
drwxr-xr-x3rootroot409609-2118:40setup_file
drwxr-xr-x9rootroot409609-1719:
drwxr-xr-x9rootroot40962022-08-
[******@localhostsoft]#scp<ahref="mailto:******@:/opt/soft/nginx-">******@:/opt/soft/nginx-</a>/opt/soft/
<ahref="mailto:******@'s">******@'s</a>password:
nginx-%:00
[******@localhostsoft]#ll
总计80556
drwxr-xr-x12rootroot409609-2118:
drwxr-xr-x3rootroot409609-2117:
drwxr-xr-x10rootroot409610-3017:
drwxr-xr-x10rootroot409609-1719:
-rwxr-xr-x1rootroot8**********-12-21jdk-6u16-linux-
drwxrwxrwx2rootroot409609-2101:16mysql
-rw-r--r--1rootroot49022003-1509:11nginx-
drwxr-xr-x3rootroot409609-2118:40setup_file
drwxr-xr-x9rootroot409609-1719:
drwxr-xr-x9rootroot40962022-08-
[******@localhostsoft]#
说明:
-
实例2:从远处复制到本地
吩咐:scp-******@:/opt/soft/mongodb/opt/soft/
输出:
复制代码代码如下:
[******@localhostsoft]#ll
总计80556
drwxr-xr-x12rootroot409609-2118:
drwxr-xr-x3rootroot409609-2117:
drwxr-xr-x10rootroot409610-3017:
drwxr-xr-x10rootroot409609-1719:
-rwxr-xr-x1rootroot8**********-12-21jdk-6u16-linux-
drwxrwxrwx2rootroot409609-2101:16mysql
-rw-r--r--1rootroot49022003-1509:11nginx-
drwxr-xr-x3rootroot409609-2118:40setup_file
drwxr-xr-x9rootroot409609-1719:
drwxr-xr-x9rootroot40962022-08-
[******@localhostsoft]#scp-r<ahref="mailto:******@:/opt/soft/mongodb">******@:/opt/soft/mongodb</a>/opt/soft/
<ahref="mailto:******@'s">******@'s</a>password:
mongodb-linux-i686-static-%:01
README100%:00
THIRD-PARTY-NOTICES100%:00
mongorestore100%:00
mongod100%:01
mongoexport100%:00
bsondump100%:00
mongofiles100%:01
mongostat100%:00
mongos100%:01
mongo100%:00
mongoimport100%:00
mongodump100%:00
GNU-AGPL-%:00
[******@localhostsoft]#ll
总计80560
drwxr-xr-x12rootroot409609-2118:
drwxr-xr-x3rootroot409609-2117:
drwxr-xr-x10rootroot409610-3017:
drwxr-xr-x10rootroot409609-1719:
-rwxr-xr-x1rootroot8**********-12-21jdk-6u16-linux-
drwxr-xr-x3rootroot409603-1509:18mongodb
drwxrwxrwx2rootroot409609-2101:16mysql