Secure Copy Protocol or SCP - 安全拷贝协议

这篇具有很好参考价值的文章主要介绍了Secure Copy Protocol or SCP - 安全拷贝协议。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

Secure Copy (remote file copy program)

The SCP program is a software tool implementing the SCP protocol as a service daemon or client. It is a program to perform secure copying. The SCP server program is typically the same program as the SCP client. The SCP Server software can be installed on a Regular Machine and be configured to only accept SCP Traffic on port 22 through the firewall for greater security.

Perhaps the most widely used SCP program is the command line scp program, which is provided in most SSH implementations. The scp program is the secure analog of the rcp command. The scp program must be part of all SSH servers that want to provide SCP service, as scp functions as SCP server too.

Some SSH implementations provide the scp2 program, which uses the SFTP protocol instead of SCP, but provides the very same command line interface as scp. scp is then typically a symbolic link to scp2.

Copying file to host:

scp SourceFile user_name@host_ip:directory/TargetFile

Copying file from host:

scp user_name@host_ip:directory/SourceFile TargetFile
scp -r user_name@host_ip:directory/SourceFolder TargetFolder

Note that if the remote host uses a port other than the default of 22, it can be specified in the command. For example, copying a file from host:

scp -P 2222 user_name@host_ip:directory/SourceFile TargetFile

1. scp 文件传输

将本地文件拷贝到远程:scp 本地路径/文件名 用户名@计算机 IP 或计算机名称:远程路径
将远程文件拷贝到本地:scp 用户名@计算机 IP 或计算机名称:远程路径/文件名 本地路径
将本地目录拷贝到远程:scp -r 本地路径/目录名 用户名@计算机 IP 或计算机名称:远程路径
将远程目录拷贝到本地:scp -r 用户名@计算机 IP 或计算机名称:远程路径/目录名 本地路径

1.1. 将远程文件拷贝到本地

strong@foreverstrong:~$ scp yongqiang@***.***.***.***:/home/yongqiang/darknet_work/darknet_180516/darknet-master.zip /home/strong/Desktop/download/
yongqiang@***.***.***.***'s password: 
darknet-master.zip                                                                                                                   100% 3571KB   3.5MB/s   00:01    
strong@foreverstrong:~$
or
strong@foreverstrong:~/Desktop/download$ scp yongqiang@***.***.***.***:/home/yongqiang/darknet_work/darknet_180516/darknet-master.zip .
yongqiang@***.***.***.***'s password: 
darknet-master.zip                                                                                                         100% 3571KB   3.5MB/s   00:00    
strong@foreverstrong:~/Desktop/download$ ll
total 3580
drwxrwxr-x 2 strong strong    4096 May 27 11:46 ./
drwxr-xr-x 7 strong strong    4096 May 27 11:37 ../
-rw-rw-r-- 1 strong strong 3656551 May 27 11:46 darknet-master.zip
strong@foreverstrong:~/Desktop/download$

1.2. 将本地文件拷贝到远程

strong@foreverstrong:~$ scp /home/strong/Desktop/download/darknet-master.zip yongqiang@***.***.***.***:/home/yongqiang/Downloads/
yongqiang@***.***.***.***'s password: 
darknet-master.zip                                                                                                                       100% 3571KB   3.5MB/s   00:00    
strong@foreverstrong:~$
or
strong@foreverstrong:~/Desktop/download$ scp ./darknet-master.zip yongqiang@***.***.***.***:/home/yongqiang/Downloads/
yongqiang@***.***.***.***'s password: 
darknet-master.zip                                                                                                         100% 3571KB   3.5MB/s   00:00    
strong@foreverstrong:~/Desktop/download$

1.3. 将远程目录拷贝到本地

strong@foreverstrong:~$ scp -r yongqiang@***.***.***.***:/home/yongqiang/Downloads /home/strong/Desktop/download/
yongqiang@***.***.***.***'s password: 
darknet-master.zip                                                                                                                       100% 3571KB   3.5MB/s   00:01    
strong@foreverstrong:~$
or
strong@foreverstrong:~/Desktop/download$ scp -r yongqiang@***.***.***.***:/home/yongqiang/Downloads ./
yongqiang@***.***.***.***'s password: 
darknet-master.zip                                                                                                         100% 3571KB   3.5MB/s   00:01    
strong@foreverstrong:~/Desktop/download$ ll
total 12
drwxrwxr-x 3 strong strong 4096 May 27 12:10 ./
drwxr-xr-x 7 strong strong 4096 May 27 11:37 ../
drwxr-xr-x 2 strong strong 4096 May 27 12:10 Downloads/
strong@foreverstrong:~/Desktop/download$

References

[1] Yongqiang Cheng, https://yongqiang.blog.csdn.net/文章来源地址https://www.toymoban.com/news/detail-851265.html

到了这里,关于Secure Copy Protocol or SCP - 安全拷贝协议的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • GPC-SCP03安全通道协议

    规范全称: GlobalPlatform Technology Secure Channel Protocol \\\'03\\\' Card Specification V2.3 - Amendment D Version 1.1.2 安全通道的建立的标志即通讯双方都形成三个安全通道共享密钥 (Derived Session Key) ,它们是Kmac, Krmac, Kenc(即标准中的 S-MAC,S-RMAC,S-ENC )。 SCP03还是分成两大部分: 第一部分,对S-MAC,

    2024年02月03日
    浏览(32)
  • Global Platform Technology安全通道协议SCP02 SCP10 SCP03 SCP11的简单分析和比较

    Global Platform Technology(以下简称为GP)的安全通道协议(Secure Channel protocol,以下简称为SCP)是可信服务管理(Trusted Service Manager,以下简称为TSM)的安全基础。 安全通道协议通常分成两大部分,第一部分是相互认证和通道初始化流程,在此流程中生成过程密钥;第二部分基于此过程密

    2024年02月04日
    浏览(25)
  • SSL(Secure Sockets Layer)安全套接层协议详解

    SSL(Secure Sockets Layer 安全套接层)协议 ,及其继任者 TLS(Transport Layer Security传输层安全)协议 ,是为网络通信提供安全及数据完整性的一种安全协议。TLS与SSL在传输层对网络连接进行加密,用于保障网络数据传输安全,利用数据加密技术,确保数据在网络传输过程中不会被截取

    2023年04月09日
    浏览(27)
  • Python - 拷贝 - 浅拷贝(Shallow Copy)和深拷贝(Deep Copy)

    假设我以这样的方式创建一个 3 x 5 的二维数组: 然后我修改 a [ 2 ] [ 3 ] a[2][3] a [ 2 ] [ 3 ] 的值为 1 1 1 : 结果会发现数组 a a a 中第二维坐标为 3 3 3 的数全部被修改为了 1 1 1 ,而没有发生“第一维坐标为 2 2 2 的数全部被改成了 1 1 1 ” 这就涉及到了Python中的拷贝机制。 Python中

    2023年04月08日
    浏览(26)
  • html通过使用图像源的协议(protocol)相对 URL 来防止安全/不安全错误

    有人知道使用 protocol relative URLs 是否有问题吗?用于图像源以防止混合内容安全警告。 例如链接一张图片: 代替: 在我的测试中,我没有看到任何迹象表明这是错误的,但我不确定它是否存在会产生问题的边缘情况。 编辑  我看到它在使用 PHP 的 getimagesize 时抛出错误功能

    2024年02月05日
    浏览(32)
  • python-浅拷贝(copy)与深拷贝(deepcopy)

    目录 一、前言: 二、深拷贝与浅拷贝的异同:         1.相同点:                2.不同点:         3.形象说明:         注意: 三、浅拷贝:  3.1.1浅拷贝示意图: 3.1.2示意图说明         1.对象与子对象(元素)的关系:         2.对象:         3.元

    2024年02月11日
    浏览(24)
  • Windows上使用SCP拷贝远程文件

    今日需要对服务器(Linux)上大约1TB的文件进行备份,最后IT的同事给我找了一台window服务器有足够的空间进行备份。接下来的问题就是怎么备份了?使用ftp/sftp没有拷贝文件夹命令,mput/mget需然可以批量操作但是都是针对文件的,我这里的场景不合适。SCP可以拷贝文件夹比较

    2024年02月03日
    浏览(28)
  • Dockerfile 指令 COPY 拷贝文件夹

    网上查了查资料,这里记录一下。         今天在编写 dockerfile 时使用 COPY 拷贝文件夹时遇到了意料之外的情况。在此记录一下正确的使用方法。         今天在通过 dockerfile 将文件夹拷贝到镜像的时候发现,是把文件夹下的内容拷贝进去了。 dockerfile 如下:     

    2024年01月18日
    浏览(41)
  • Kafka的零拷贝技术Zero-Copy

    流程步骤: (1)操作系统将数据从磁盘文件中读取到内核空间的页面缓存; (2)应用程序将数据从内核空间读入用户空间缓冲区; (3)应用程序将读到数据写回内核空间并放入socket缓冲区; (4)操作系统将数据从socket缓冲区复制到网卡接口,此时数据才能通过网络发送

    2024年02月08日
    浏览(31)
  • C++ 惯用法之 Copy-Swap 拷贝交换

    这是“C++ 惯用法”合集的第 3 篇,前面 2 篇分别介绍了 RAII 和 PIMPL 两种惯用法: RAII: Resouce Acquistion Is Initialization PIMPL:Pointer To Implemetation 正式介绍 Copy-Swap 之前,先看下《剑指 Offer》里的第☝️题: 如下为类型 CMyString 的声明,请为该类型添加赋值运算符函数。 这道题目虽

    2024年02月13日
    浏览(26)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包