SCP的两个问题解决

参考文章:

https://www.cnblogs.com/jockechen/articles/10407093.html

https://www.cnblogs.com/huanghongbo/p/6254400.html

https://blog.csdn.net/dafei4/article/details/79494324

 

scp使用

从linux系统复制文件到windows系统:

scp <linux_path> administrator@<windows_ip>:<windows_path>

在linux环境下,将windows下的文件复制到linux系统中:

scp administrator@<windows_ip>:<windows_path> <linux_path>

windows的路径用'/'作为分隔符。

请注意:因为windows系统本身不支持ssh协议,所以,要想上面的命令成功执行,必须在windows客户端安装ssh for windows的客户端软件,比如winsshd,使windows系统支持ssh协议才行。

以上的命令我没试过,以前好像是用putty直接完成的,也不需要输入命令,可以直接拖拽。

 

linux 到 linux :

scp <src_path> <dest_username>@<dest_ip>:<dest_path>

scp source  destination_username@destination_ip:destination_filepath   #注意#目的地的url路径中不要漏掉冒号。

 

报错一:

The authenticity of host '114.212.xx.xx (114.212.xx.xx)' can't be established.
ECDSA key fingerprint is SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
Are you sure you want to continue connecting (yes/no)? 

解决方法:

不要选择yes或no,直接ctrl+c。然后输入下面命令

ssh  -o StrictHostKeyChecking=no  114.212.xx.xx

输入密码。接着exit登出,系统输出以下两行:

logout
Connection to 114.212.xx.xx closed.

回到了原来的服务器。

接着重新使用scp命令就不会报错了。

 

报错二:

.: not a regular file

表明当前目录不是一个文件,因为是个文件夹。如果传送单个文件是不会出错的。

解决方法:

scp -r <src_path> <dest_username>@<dest_ip>:<dest_path>

加个-r参数就好了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值