SchoofsKelvin / vscode-sshfs

Extension for Visual Studio Code: File system provider using SSH
GNU General Public License v3.0
543 stars 36 forks source link

Doesn't work for Synology NAS #408

Open Identifier opened 7 months ago

Identifier commented 7 months ago

Possibly related to #303. On my Synology NAS, even with SFTP enabled, it doesn't have /usr/lib/openssh/sftp-server or even /usr/libexec/sftp-server. In fact, sudo find / -name sftp-server returns nothing at all.

I noticed in /etc/ssh/sshd_config they have:

# override default of no subsystems
#Subsystem  sftp    /usr/libexec/sftp-server
Subsystem       sftp    internal-sftp -f DAEMON -u 000

Is there any way to get this extension working in this case? I tried adding "flags": ["CHECK_HOME=false"] to my settings.json/sshfs.configs for my host, but I couldn't see any difference. Here are the complete logs from the output window:

[INFO]    
Created output channel for vscode-sshfs
When posting your logs somewhere, keep the following in mind:
  - While the logging tries to censor your passwords/passphrases/..., double check!
    Maybe you also want to censor out e.g. the hostname/IP you're connecting to.
  - If you want to report an issue regarding authentication or something else that
    seems to be more of an issue with the actual SSH2 connection, it might be handy
    to reconnect with this added to your User Settings (settings.json) first:
      "sshfs.flags": [ "DEBUG_SSH2" ],
    This will (for new connections) also enable internal SSH2 logging.

[INFO]    Loading configurations...
[INFO]    Calculated config flags: {"fs_notify_errors":["write","Fix for issue #282"]}
[DEBUG]     Added configuration synology-root from [1]
[INFO]    Applied config layers resulting in 1 configurations
[INFO]    Extension activated, version 1.26.1, mode 1
[DEBUG]   Running VS Code version 1.84.2 {
    "node": "18.15.0",
    "v8": "11.4.183.29-electron.0",
    "uv": "1.44.2",
    "zlib": "1.2.13",
    "brotli": "1.0.9",
    "ares": "1.18.1",
    "modules": "116",
    "nghttp2": "1.51.0",
    "napi": "8",
    "llhttp": "6.0.10",
    "uvwasi": "0.0.15",
    "acorn": "8.8.2",
    "simdutf": "3.1.0",
    "undici": "5.20.0",
    "openssl": "1.1.1",
    "cldr": "42.0",
    "icu": "72.1",
    "tz": "2023a",
    "unicode": "15.0",
    "electron": "25.9.2",
    "microsoft-build": "24603566",
    "chrome": "114.0.5735.289"
}
[INFO]    Version history: 1.26.1:1700739264566:1700743382844
[INFO]    Command received to connect synology-root
[INFO]    [createConnection(synology-root,config)] Creating a new connection for 'synology-root'
[INFO]    Calculating actual config
[DEBUG]     No privateKey, agent or password. Gonna prompt for password
[DEBUG]     Final configuration:
{
    "name": "synology-root",
    "host": "synology",
    "username": "<censored>",
    "sftpSudo": true,
    "_location": 1,
    "_locations": [
        1
    ],
    "_calculated": {
        "name": "synology-root",
        "host": "synology",
        "username": "<censored>",
        "sftpSudo": true,
        "_location": 1,
        "_locations": [
            1
        ]
    },
    "port": 22,
    "password": "<censored>"
}
[INFO]    [createSocket(synology-root)] Creating socket
[DEBUG]   [createSocket(synology-root)] Connecting to synology:22
[INFO]    [createSSH(synology-root)] Flag "OPENSSH-SHA1" enabled due to 'missing'
[INFO]    [createConnection(synology-root,config)] Remote version: OpenSSH_8.2
[DEBUG]   [createConnection(synology-root,config)] Detected known $SHELL '/bin/sh' (sh)
[DEBUG]   [createConnection(synology-root,config)] Home path: /var/services/homes/<censored>
[DEBUG]   [createConnection(synology-root,config)] Environment: []
[INFO]    Reloading workspace folder configs for 'synology-root' connection
[DEBUG]     Added configuration synology-root from [1]
[INFO]    Applied config layers resulting in 1 configurations
[WARNING] [getSFTP(synology-root)] sftpSudo is set without sftpCommand. Assuming /usr/lib/openssh/sftp-server
Logged at:
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at c:\Users\<censored>\.vscode\extensions\kelvin.vscode-sshfs-1.26.1\dist\extension.js:1:64947
Reported by logger getSFTP(synology-root)
[INFO]    [getSFTP(synology-root)] Creating SFTP session using specified command: /usr/lib/openssh/sftp-server
[DEBUG]   Turning shell into a sudo shell for default sudo user
[INFO]    [SSHFileSystem(synology-root)] SSHFileSystem created
[INFO]    Created SSHFileSystem for synology-root, reading root directory...

At this point it just sits there indefinitely...

luckman212 commented 7 months ago

Try enabling the User Home service and then connect as a non-root user

image
Identifier commented 7 months ago

It's enabled. My user does have a home folder already.

luckman212 commented 7 months ago

are you using passwords or public key auth?

Identifier commented 7 months ago

Was using passwords.

But since then I've switched to keys and also I just switched to vscode's Remote-SSH for everything.