linux中的scp命令怎么用
发表于:2024-10-20 作者:千家信息网编辑
千家信息网最后更新 2024年10月20日,小编给大家分享一下linux中的scp命令怎么用,希望大家阅读完这篇文章之后都有所收获,下面让我们一起去探讨吧!scp是secure copy的简写, 是 linux 系统下基于 ssh 登陆进行安全
千家信息网最后更新 2024年10月20日linux中的scp命令怎么用
小编给大家分享一下linux中的scp命令怎么用,希望大家阅读完这篇文章之后都有所收获,下面让我们一起去探讨吧!
scp是secure copy的简写, 是 linux 系统下基于 ssh 登陆进行安全的远程文件拷贝命令。scp 是加密的,rcp 是不加密的,scp 是 rcp 的加强版。
基本格式
scp source target
将本地文件复制到远端服务器上
[student@servera ~]scp log.tar root@serverb:/logbackupThe authenticity of host 'serverb (172.25.250.11)' can't be established.ECDSA key fingerprint is SHA256:BCd8VCfEpGbUo3zb1De0hd1Q5nOMEzYNpMFu5o7j4Fg.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added 'serverb,172.25.250.11' (ECDSA) to the list of known hosts.root@serverb's password:log.tar 100% 11MB 20.8MB/s 00:00 [student@servera ~] ssh root@serverb "ls /logbackup"root@serverb's password:log.tar
root@ 是可选项,如果不指定,则使用你当前的本地用户。你所使用的用户必须要对远端主机上的对应目录有相应的权限。 和 ssh 一样,第一次连接的时候,会有一个安全性的提示,选项 yse 就可以了,因为 scp 就是 OpenSSH 的一部分。
从远端就复制文件到本地
[student@servera ~]scp root@serverb:/logbackup/log.tar backup/root@serverb's password:log.tar 100% 11MB 25.5MB/s 00:00 [student@servera ~] ls backup/log.tar
如果是目录,我们可以通过 -r 选项进行递归的方式,复制整个目录内容
[student@servera ~]$ scp -r root@serverb:/var/log/ backup/root@serverb's password:lastlog 100% 285KB 5.9MB/s 00:00 README 100% 1040 260.8KB/s 00:00 wtmp 100% 6912 2.6MB/s 00:00 btmp 100% 0 0.0KB/s 00:00 audit.log 100% 208KB 8.0MB/s 00:00 sssd.log 100% 0 0.0KB/s 00:00 sssd_implicit_files.log 100% 109 32.9KB/s 00:00 sssd_nss.log 100% 94 8.6KB/s 00:00 rhsm.log 100% 3642 1.0MB/s 00:00 tuned.log 100% 2434 904.9KB/s 00:00 messages 100% 1459KB 18.1MB/s 00:00 secure 100% 8298 3.4MB/s 00:00 maillog 100% 0 0.0KB/s 00:00 spooler 100% 0 0.0KB/s 00:00 dnf.log 100% 107KB 3.4MB/s 00:00 dnf.librepo.log 100% 245KB 8.4MB/s 00:00 dnf.rpm.log 100% 21KB 2.3MB/s 00:00 hawkey.log 100% 18KB 3.8MB/s 00:00 cron 100% 7166 706.4KB/s 00:00 boot.log 100% 0 0.0KB/s 00:00
我们还可以使用 scp 把一个文件从远端的一台主机,复制到另外一台主机上
[student@workstation ~]scp student@servera:/home/student/log.tar student@serverb:/home/student/student@serverb's password:log.tar 100% 670KB 19.6MB/s 00:00 Connection to servera closed.[student@workstation ~] ssh student@serverb "ls -l"total 672-rw-rw-r--. 1 student student 686080 Nov 6 20:54 log.tar
看完了这篇文章,相信你对"linux中的scp命令怎么用"有了一定的了解,如果想了解更多相关知识,欢迎关注行业资讯频道,感谢各位的阅读!
文件
命令
主机
目录
安全
用户
篇文章
加密
内容
可以通过
安全性
完了
就是
拷贝
方式
时候
更多
服务器
权限
格式
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
怎么打开数据库服务
戴尔t30服务器更换硬盘
dede连接数据库
认证服务器网络异常
typedef数据库
曙光服务器管理密码
技嘉ud3r支持服务器内存条吗
网络技术与管理考研方向
深圳互联网 未来科技城
软件开发技能介绍
国家网络安全宣传周观安
光纤专线接服务器
局域网web数据库
系统管理服务器作用
软件开发要不要学ui
网络安全法案例2000字
网络安全行业的核心技术
天女兽数据库
网络安全知识内容文字三年级
成都富翼软件开发有限公司
数据库如何保证服务器安全
南沙app软件开发价格表
在日本地图软件开发
绵阳打卡软件开发
软件开发人员工作时间
vue 数据库提取图片地址
发生网络安全事件简易报告程序
scum如何搭建服务器
网络安全审查的重点是
什么叫数据库的管理系统