SCP远程拷贝命令

简介:

利用scp指令可以在linux机器间传递文件,个人使用几次感觉效率还是较高的,比SFTP+本地做媒介要高得多。

1.本地拷贝到远程

这种方式的命令模式是scp local_file remote_username@remote_ip:remote_file

示例如下:

[root@msg45 hy]# ls
rpm  test.txt  wasliberty

将test.txt从本地拷贝到远程
[root@msg45 hy]# scp test.txt root@msg43.matson.ufo.com:/home/hy/
The authenticity of host 'msg43.matson.ufo.com (91.200.193.93)' can't be established.
RSA key fingerprint is dc:ab:dc:c8:09:6d:c7:fe:b5:f6:b8:9a:93:89:75:07.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'msg43.matson.ufo.com,91.200.193.93' (RSA) to the list of known hosts.
root@msg43.matson.ufo.com's password: 
test.txt                                                                                                                                       100%   15     0.0KB/s   00:00    
[root@msg45 hy]#

2.远程拷贝到本地

从 远程 复制到 本地,只要将 从 本地 复制到 远程 的命令 的 后2个参数 调换顺序 即可,如下。

scp  remote_username@remote_ip:remote_file local_file

示例如下:

[root@msg45 hy]# scp root@msg43.matson.ufo.com:/home/hy/test.txt  test1.txt
root@msg43.matson.ufo.com's password: 
test.txt                                                                                                                                       100%   15     0.0KB/s   00:00    
[root@msg45 hy]#












本文转自张昺华-sky博客园博客,原文链接:http://www.cnblogs.com/xiandedanteng/p/3524157.html,如需转载请自行联系原作者



相关文章
Ansible 文件从远程取文件fetch和传文件到远程copy(学习笔记四)
fetch模块: copy模块: 1、从远程主机获取文件:ansible all -m fetch -a "src=/root/test.sh dest=/root/test" image.
4686 0
|
5月前
Linux-远程拷贝(scp命令)
Linux-远程拷贝(scp命令)
32 0
头疼:ansible坑之拷贝目录不报错,远程主机没有目录
头疼:ansible坑之拷贝目录不报错,远程主机没有目录
211 0
|
监控
【远程】rsync远程同步文件、快速清空大文件
文章目录 前言 一、概念/应用环境 二、搭建/操作实例
178 0
scp -P -R 远程复制文件(夹) 到 指定端口 指定服务器 指定 目录
scp -P -R 远程复制文件(夹) 到 指定端口 指定服务器 指定 目录
996 0
scp -P -R 远程复制文件(夹) 到 指定端口 指定服务器 指定 目录
|
数据安全/隐私保护
两台服务器间传输文件【scp命令】
两台服务器间传输文件【scp命令】
两台服务器间传输文件【scp命令】
|
安全 Linux 网络安全
28. scp远程拷贝
scp 用于 Linux 之间复制文件和目录。scp 是 secure copy 的缩写, scp 是 linux 系统下基于 ssh 登陆进行安全的远程文件拷贝命令。scp命令是加密的,rcp命令 是不加密的,scp 是 rcp 的加强版。
162 0
|
Windows
liunx之拷贝命令cp
cp(全称:copy file)用于复制文件或目录。
181 0
|
安全 网络协议 Linux
SCP:不同Linux服务器间的复制
SCP:不同Linux服务器间的复制
184 0
|
Linux 数据安全/隐私保护 网络安全

相关实验场景

更多