如何使用 SFTP 中的 pem 文件将 EC2 实例与 VSCode Directy 连接 [英] How to Connect EC2 Instance with VSCode Directy using pem file in SFTP
本文介绍了如何使用 SFTP 中的 pem 文件将 EC2 实例与 VSCode Directy 连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用 SFTP 直接从 VS Code 连接 EC2 实例.我可以使用 [password] 类型连接其他 ftp 服务,但对于 EC2 实例,我只有 .pem 文件.期待这样的事情,但使用公钥 .pem 文件
I'm trying to connect EC2 Instance directly from VS Code using SFTP. I can able to connect other ftp service using [password] type, but for EC2 instance i'm having only .pem file. Expecting something like this but using public key .pem file
{
"protocol": "sftp",
"host": "localhost",
"port": 22,
"username": "username",
"remotePath": "/"
}
推荐答案
试试这个VScode 上的 config.json
Try this config.json on VScode
{
"remotePath": "/",
"host": "<IP-OR_EC2-INSTANCE-HOST-NAME>",
"username": "USERNAME",
"password": "PASSWORD",
"port": 22,
"secure": true,
"protocol": "sftp",
"uploadOnSave": true,
"passive": false,
"debug": true,
"privateKeyPath": "<PATH-TO-PEM-FILE>",
"passphrase": null,
"ignore": [
------
],
"generatedFiles": {
"uploadOnSave": false,
"extensionsToInclude": [],
"path": ""
}
}
这篇关于如何使用 SFTP 中的 pem 文件将 EC2 实例与 VSCode Directy 连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文