windows cmd使用ssh连接Linux以及文件上传

  • Post author:
  • Post category:linux


CMD连接服务器命令(47.102.144.221 为服务器 IP)

ssh root@47.102.144.221

文件上传(scp 后面参数为本地文件地址 , 47.102.144.221 为服务器 IP, 冒号后面指 将文件上传到服务器哪个目录下)

scp D:\index.txt root@47.102.144.221:/server/tmp

如何要从服务器下载文件 还是使用scp命令如下:

scp root@47.102.144.221:/server/tmp/index.txt D:\

如下图:

在这里插入图片描述

如果连接 ssh 出现如下提示:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:AGHOfHIMAAhNrmTq6XsWnKxbNZco4UiovRyG50CN+Wk.
Please contact your system administrator.
Add correct host key in C:\\Users\\13160/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in C:\\Users\\13160/.ssh/known_hosts:2
ECDSA host key for 47.102.144.221 has changed and you have requested strict checking.
Host key verification failed.

执行

ssh-keygen -R 47.102.144.221

删除本地密钥即可



版权声明:本文为weixin_40516924原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。