可以通过Ubuntu上的VSCODE SFTP扩展22.04 OS连接到AWS EC2服务器

发布于 2025-01-30 02:41:58 字数 582 浏览 4 评论 0原文

我曾经连接Linode和GCP提供的远程服务器,并通过SFTP扩展使用Visual Studio代码,所有这些都可以正常工作。但是,使用相同的配置,我无法连接到我的AWS EC2服务器。 以下是sftp.json(更改敏感信息)

“

,AWS安全设置如下

奇怪的是,我可以SSH连接到终端上的服务器,并且可以使用Filezilla发送具有相同凭据的文件。但是我无法通过Visual Studio Code SFTP或SSH远程扩展连接到它。

I used to connect remote servers provided by Linode and GCP and I use Visual Studio Code via Sftp extension and all works just fine. However, with the same set of configurations, I couldn't connect to my Aws EC2 server.
The following is the sftp.json (with sensitive information changed)

json file sample

And the aws security setting is as following
aws security settings

The strange thing is that I can ssh connect to the server on the terminal and I can use filezilla to send file with the same credential as well. But somehow I can't connect to it via Visual Studio Code sftp or SSH remote extension.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

爱,才寂寞 2025-02-06 02:41:58

我在互联网上搜索了答案,并找到了一个对我有用的答案。
问题与Ubuntu 22.04默认服务器默认密钥设置有关,而不是VSCODE。

该解决方案将以下内容添加到:/etc/ssh/sshd_config

PubkeyAcceptedKeyTypes=+ssh-rsa

in /etc/etc/etc/sssh/ssh/sshd_config

,然后在服务器上重新启动服务

sudo systemctl restart sshd

源答案的内容来自 https://github.com/liximomo/liximomo/vscode-sftp/sftp/ssftp/issues /37 在用户 Windware-ono 的答案下。

I searched the answer on the internet and found an answer that worked for me.
The problem has to do with the Ubuntu 22.04 default server default key setting and not with the VSCode.

The solution is adding the following to: /etc/ssh/sshd_config:

PubkeyAcceptedKeyTypes=+ssh-rsa

in /etc/ssh/sshd_config

and then restart the service on the server with the following command

sudo systemctl restart sshd

The source of the answer comes from https://github.com/liximomo/vscode-sftp/issues/37 under the user windware-ono's answer.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文