用scp完成本机到服务器的文件传输
scp命令:Copy files between hosts using Secure Copy Protocol over SSH.
一:从本地上传文件到服务器:
-Copy a local file to a remote host:
scp path/to/local_file remote_host:path/to/remote_file
scp 本机文件路径 用户名@ip:服务器端目的路径
具体使用举例:本地的/tmp目录下有一个叫做local_file的文件,传到zhangjie用户的/tmp下
到服务器中查看已经上传的文件
二:从服务器下载文件到本地:
- Copy a file from a remote host to a local directory:
scp remote_host:path/to/remote_file path/to/local_directory
scp 用户名@ip:服务器端路径 本机目的路径
具体使用举例:在服务器的/tmp目录下有一个remote_file,下载到本机的/tmp目录下
本机中查看下载的文件