scp Connection closed 问题解决

如果在使用ssh 通过window 链接Linux的服务时,出现以下错误

C:\Windows\System32\OpenSSH\scp.exe: Connection closed。
这通常表示连接被意外关闭,以下时可能得原因及解决方法。

scp file.txt user@remote:/path/to/destination
c:\windows\system32\openssh\scp.exe: connection closed

1、使用scp 协议非SFTP

有时候,服务器没有实现SFTP,可以通过添加 -O 参数强制使用scp协议
scp -O file.txt user@remote:/path/to/destination

如果在使用ssh 过程中出现以下错误

Permission denied (publickey,password,keyboard-interactive).

检查服务和客户端的ssh 公钥是否一致。

在window端拷贝
~/.ssh/id_rsa.pub 公钥,

将该公钥添加到服务器端
~/.ssh/authorized_keys 文件中

检查~/.ssh/authorized_keys 权限,保证时600权限

chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值