【问题标题】:Can't connect to SFTP server through Sublime 3 Package SFTP无法通过 Sublime 3 Package SFTP 连接到 SFTP 服务器
【发布时间】:2015-12-25 09:16:54
【问题描述】:

我有一个 SFTP 服务器,我想用 Sublime Text 3 中的 SFTP 包连接它。

由于某种原因,我每次尝试连接时都会超时。 SSH 密钥设置正确,我也可以使用 WinSCP、FileZilla 和 PuTTy 连接到服务器。

这是错误:

Connecting to SFTP server "pirpi.pil.dk" as "devafdoede" ....... failure (Connection timeout)

只是不想连接的 Sublime SFTP 包。这是我的配置:

{
// The tab key will cycle through the settings when first created
// Visit http://wbond.net/sublime_packages/sftp/settings for help

// sftp, ftp or ftps
"type": "sftp",

"save_before_upload": true,
"upload_on_save": false,
"sync_down_on_open": false,
"sync_skip_deletes": false,
"sync_same_age": true,
"confirm_downloads": false,
"confirm_sync": true,
"confirm_overwrite_newer": false,

"host": "pirpi.pil.dk",
"user": "devafdoede",
//"password": "password",
//"port": "22",

"remote_path": "/mypath",
"ignore_regexes": [
    "\\.sublime-(project|workspace)", "sftp-config(-alt\\d?)?\\.json",
    "sftp-settings\\.json", "/venv/", "\\.svn/", "\\.hg/", "\\.git/",
    "\\.bzr", "_darcs", "CVS", "\\.DS_Store", "Thumbs\\.db", "desktop\\.ini"
],
//"file_permissions": "664",
//"dir_permissions": "775",

//"extra_list_connections": 0,

"connect_timeout": 30,
//"keepalive": 120,
//"ftp_passive_mode": true,
//"ftp_obey_passive_host": false,
//"ssh_key_file": "~/.ssh/id_rsa",
//"sftp_flags": ["-F", "/path/to/ssh_config"],

//"preserve_modification_times": false,
//"remote_time_offset_in_hours": 0,
//"remote_encoding": "utf-8",
//"remote_locale": "C",
//"allow_config_upload": false,
}

【问题讨论】:

    标签: package sublimetext3 sftp


    【解决方案1】:

    如果您使用的是 Windows,则需要添加特定的 ssh_key_file。

    来自 SFTP 常见问题解答:

    对于 Windows,Sublime SFTP 使用 PSFTP,它是随同发布的 油灰。 将自动使用加载到 Pageant 中的任何键。它是 也可以提供 .ppk 私钥文件作为 ssh_key_file SFTP 远程设置。 .ppk 文件可以从头开始生成, 或现有的 OpenSSH 私钥,通过 PuTTYgen。所有这些 实用程序可以从 PuTTY 站点下载,但是没有 Sublime SFTP 完全运行所必需的。

    您需要使用 PuTTYgen 创建您的私钥文件并打开 Pageant 并选择密钥。

    在这里阅读更多: http://wbond.net/sublime_packages/sftp/faq#SSHKeys http://the.earth.li/~sgtatham/putty/0.61/htmldoc/Chapter9.html#pageant

    您需要在 sftp 配置中指定 ssh_key

    【讨论】:

    • 应该在server 配置和sftp-config 文件上声明两次
    • 我有两个版本:id_rsa 和 id_rsa.ppk。我立即使用非 ppk 版本获得(连接超时)。所以我在 Sublime 的 SFTP 配置中切换到 .ppk 版本,现在它可以工作了。然后我切换回非 ppk 版本,它现在也可以与那个版本一起使用!?...我的私钥受密码保护。当我切换到 .ppk 版本时,它只要求我输入密码。当我切换回非 ppk 时,它没有询问我的密码。这很奇怪。
    • 也许您需要在第一次连接时接受 RSA 指纹?使用无密码查询。
    • 我所做的只是使用我的 .pem 密钥切换到 .ppk 密钥并且它起作用了。谢谢!
    猜你喜欢
    • 1970-01-01
    • 2020-10-22
    • 2011-05-21
    • 2020-09-16
    • 1970-01-01
    • 2021-07-26
    • 1970-01-01
    • 2023-03-16
    • 1970-01-01
    相关资源
    最近更新 更多