首页 > 其他分享 >Secure Copy Protocol or SCP - 安全拷贝协议

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

时间:2024-04-10 23:31:18浏览次数:21  
标签:yongqiang strong Protocol Secure darknet SCP Copy scp foreverstrong

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/

标签:yongqiang,strong,Protocol,Secure,darknet,SCP,Copy,scp,foreverstrong
From: https://blog.csdn.net/chengyq116/article/details/137614010

相关文章

  • SqlBulkCopy批量插入数据
    privatevoiduiButton1_Click(objectsender,EventArgse){DataTabledt=newDataTable();dt.Columns.Add("CreateBy",typeof(System.Int64));dt.Columns.Add("CreateTime",typeof(System.Dat......
  • cmd通过copy命令合并文件
    在Windows的命令提示符(CMD)中,copy命令可以用来合并文件内容。以下是如何使用copy命令合并文件内容的基本步骤:打开命令提示符(CMD)。使用cd命令导航到包含你要合并的文件的目录。使用以下命令合并文件:copy/b文件1+文件2目标文件这里,/b选项告诉copy命令以二进制模......
  • As a reader --> NetDiffusion: Network Data Augmentation Through Protocol-Constra
    ......
  • SecureCRT通过私钥连接跳板机,再连接到目标服务器
    文章目录1.配置第一个session(跳板机)2.设置本地端口3.设置全局firewall4.配置第二个session(目标服务器)服务器那边给了一个私钥,现在需要通过私钥连接跳板机,再连接到目标服务器上......
  • 使用SecureCRT上传大于4G的文件:is too large for zmodem.ZModem does not support fil
    问题使用SecureCRT通过rz命令上传大于4G的文件时,软件报错解决需要通过SecureRCT自带的SFTP解决。使用快捷键alt+p打开SFTP会话上传文件Windows->Linux#向服务器上传文件put<targetfile>#向服务器上传文件夹及内容put-r<targetdirectory>下载文件Lin......
  • 多线程(34)CopyOnWriteArrayList
    CopyOnWriteArrayList是Java中一个线程安全的ArrayList变体,属于java.util.concurrent包。它通过在所有修改操作(如add,set等)上执行显式复制来实现线程安全。这种设计适用于列表读操作的数量远远大于写操作的场景。设计原理CopyOnWriteArrayList的基本思想是,每当......
  • Adobe InCopy 2024 v19.3 (macOS, Windows) - 编写和副本编辑软件
    AdobeInCopy2024v19.3(macOS,Windows)-编写和副本编辑软件Acrobat、AfterEffects、Animate、Audition、Bridge、CharacterAnimator、Dimension、Dreamweaver、Illustrator、InCopy、InDesign、LightroomClassic、MediaEncoder、Photoshop、PremierePro、AdobeXD......
  • IP(Internet Protocol)是一种网络协议,用于在网络中发送和接收数据包
    IP(InternetProtocol)是一种网络协议,用于在网络中发送和接收数据包。它是一个无连接的、不可靠的数据报协议,负责将数据从源主机传输到目标主机。IP协议的主要功能包括寻址、路由和分段。寻址:IP协议为每个连接到网络的设备分配一个唯一的IP地址,这个地址用于在网络中识别设备......
  • python 3 : list 与 深copy/浅copy
    按语:               之前,论述了python可变数据类型与不可变数据类型。        这里继续补丁list与深copy/浅copy。               这里补充一下,深copy/浅copy是python宇宙中最离奇的存在!       令99%的小白求生不......
  • [cisco] notes - CCNP OSPF - Fund1: Link State Protocol Operation
    LinkStateUpdates(LSUs):containLinkStateAdvertisements(LSAs)thatpalcedintoalinkstatedatabaseToensurethatOSPFroutershavethemostrecentinfomationpssibleintheirdatabase,theLSAsareassignedsequencenumbers.TheroleoftheDRand......