linux高級(jí)拷貝命令scp怎么使用

本文小編為大家詳細(xì)介紹“l(fā)inux高級(jí)拷貝命令scp怎么使用”,內(nèi)容詳細(xì),步驟清晰,細(xì)節(jié)處理妥當(dāng),希望這篇“l(fā)inux高級(jí)拷貝命令scp怎么使用”文章能幫助大家解決疑惑,下面跟著小編的思路慢慢深入,一起來(lái)學(xué)習(xí)新知識(shí)吧。

成都創(chuàng)新互聯(lián)公司-專業(yè)網(wǎng)站定制、快速模板網(wǎng)站建設(shè)、高性價(jià)比蒙自網(wǎng)站開(kāi)發(fā)、企業(yè)建站全套包干低至880元,成熟完善的模板庫(kù),直接使用。一站式蒙自網(wǎng)站制作公司更省心,省錢,快速模板網(wǎng)站建設(shè)找我們,業(yè)務(wù)覆蓋蒙自地區(qū)。費(fèi)用合理售后完善,十多年實(shí)體公司更值得信賴。

linux命令scp

scp — secure copy (remote file copy program):她是一個(gè)安全的遠(yuǎn)程文件拷貝程序。

synopsis :語(yǔ)法如下
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

看到上面各種參數(shù)、選項(xiàng)蒙了吧。不過(guò),沒(méi)有關(guān)系,我們化整為零,一個(gè)一個(gè)來(lái)分析。
其實(shí),這個(gè)命令和我們平時(shí)使用的cp 十分的相似。

scp 最簡(jiǎn)單的用法就是 scp [[user@]host1:]file1 ... [[user@]host2:]file2 ,能看懂么?
看不懂也沒(méi)有關(guān)系,舉個(gè)例子吧: 我要從192.168.1.2的linux 主機(jī)的/home/oracle/*.tar 文件 拷貝到 192.168.1.3 的linux主機(jī)的 /home/siebel下,就可以仿照上面的格式寫(xiě)成:
scp oracle@192.168.1.2:/home/oracle/*.tar  siebel@192.168.1.3:/siebel/
輸入完了以上命令,回車換行確認(rèn),可能會(huì)讓你輸入口令,根據(jù)提示輸入口令吧。
第一次執(zhí)行的時(shí)候,出現(xiàn)如下錯(cuò)誤:ssh: connect to host 192.168.1.99 port 22: connection refused, 于是將 sshd 程序啟動(dòng),執(zhí)行腳本: # /etc/init.d/sshd start, 成功解決以上問(wèn)題。

至于該命令的其他參數(shù),平時(shí)工作之中基本用不到,所以,不舉例了,簡(jiǎn)單給大家翻譯一下吧,以做參考。

description : 描述
scp copies files between hosts on a network.  it uses ssh(1) for data transfer, and uses the same authentication and provides the same security as ssh(1).  unlike rcp(1), scp will ask for passwords or passphrases if they are needed for authentication.
scp 在網(wǎng)絡(luò)主機(jī)之間拷貝數(shù)據(jù),她使用ssh(1)來(lái)進(jìn)行數(shù)據(jù)傳輸,同時(shí)使用相同的安全驗(yàn)證方式。不象 rcp(1), scp 在必要的時(shí)候,會(huì)詢問(wèn)口令。

the options are as follows:
具體的選項(xiàng)如下所示:
-1 forces scp to use protocol 1.
   強(qiáng)制 scp 使用協(xié)議1

-2 forces scp to use protocol 2.
強(qiáng)制 scp 使用協(xié)議2

-3 copies between two remote hosts are transferred through the local host.without this option the data is copied
 directly between the two remote hosts.note that this option disables the progress meter.
通過(guò)本機(jī)主機(jī)在兩個(gè)遠(yuǎn)程主機(jī)之間傳輸數(shù)據(jù)。沒(méi)有這個(gè)選項(xiàng),數(shù)據(jù)將直接在遠(yuǎn)程主機(jī)間拷貝數(shù)據(jù)。 注意:這個(gè)選項(xiàng)不支持進(jìn)度條顯示。

-4 forces scp to use ipv4 addresses only.
強(qiáng)制scp只使用ipv4地址。

-6 forces scp to use ipv6 addresses only.
 強(qiáng)制scp只使用ipv6地址。

-b selects batch mode (prevents asking for passwords or passphrases).
 使用批量模式(避免詢問(wèn)密鑰或者口令)

-c compression enable.passes the -c flag to ssh(1) to enable compression.
啟用壓縮。傳遞-c參數(shù)給ssh以啟用壓縮

-c cipher
 selects the cipher to use for encrypting the data transfer.this option is directly passed to ssh(1).
 選擇密碼加密數(shù)據(jù)傳輸,這個(gè)選項(xiàng)被直接傳遞給ssh(1)。

-f ssh_config
 specifies an alternative per-user configuration file for ssh.this option is directly passed to ssh(1).
為ssh指定一個(gè)交互的用戶配置文件,這個(gè)選項(xiàng)被直接傳遞給ssh(1)。

-l limit
 limits the used bandwidth, specified in kbit/s.
 限制使用的帶寬,以kb為單位。

-p port
 specifies the port to connect to on the remote host.
 在遠(yuǎn)程主機(jī)上指定鏈接端口
-q quiet mode
 靜默模式:

-r recursively copy entire directories
遞歸拷貝整個(gè)目錄

-s program
 name of program to use for the encrypted connection.the program must understand ssh(1) options.
用來(lái)加密鏈接的程序。這個(gè)程序需要能夠識(shí)別ssh(1)的選項(xiàng)。

exit status
執(zhí)行后狀態(tài)
the scp utility exits 0 on success, and >0 if an error occurs.
scp 工具命令當(dāng)成功執(zhí)行后,返回代碼為0, 任何錯(cuò)誤出現(xiàn)返回代碼都大于0

讀到這里,這篇“l(fā)inux高級(jí)拷貝命令scp怎么使用”文章已經(jīng)介紹完畢,想要掌握這篇文章的知識(shí)點(diǎn)還需要大家自己動(dòng)手實(shí)踐使用過(guò)才能領(lǐng)會(huì),如果想了解更多相關(guān)內(nèi)容的文章,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道。

網(wǎng)頁(yè)題目:linux高級(jí)拷貝命令scp怎么使用
本文網(wǎng)址:http://muchs.cn/article42/ihsiec.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供建站公司、Google、網(wǎng)站排名、微信公眾號(hào)、商城網(wǎng)站、域名注冊(cè)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

綿陽(yáng)服務(wù)器托管