2

I want to edit server file using SSH-FS that is extensions of Visual Studio Code. I want to connect server without to input password using ssh-agent. How should I set?

I tried following settings.

I can connect server without password prompts by following setting but I cannot use ssh-agent:

"sshfs.configs": [
    {
        "name": "<server_name>",
        "host": "<server_ip_address>",
        "port": 22,
        "username": "user",
        "privateKeyPath": "<path_to_private_key>",
        "root": "/",
        "sftpSudo": "root",
        "passphrase": "<passphrase_of_private_key>",
        "password": "<password_of_sudo>",
    }
]

I can connect the server using ssh-agent by following setting but I should input the password:

"sshfs.configs": [
    {
        "name": "<server_name>",
        "host": "<server_ip_address>",
        "port": 22,
        "username": "user",
        "agent": "//./pipe/openssh-ssh-agent",
        "root": "/",
        "sftpSudo": "root",
    }
]

I cannot connect the server by following setting:

"sshfs.configs": [
    {
        "name": "<server_name>",
        "host": "<server_ip_address>",
        "port": 22,
        "username": "user",
        "agent": "//./pipe/openssh-ssh-agent",
        "root": "/",
        "sftpSudo": "root",
        "password": "<password_of_sudo>",
    }
]

Here is why I want to set it up like this:

  • I want to connect multiple servers in this workspace but vscode supports only one password prompt. Two or more prompts are not displayed and I cannot enter that passwords.
  • I want not write passphrase of the private key to any files.

Thank you.

taka
  • 31
  • 4

1 Answers1

1

This is quite a late response, but if this is still an issue, I suggest making an issue on GitHub.

Currently, the extension can act a bit weird if you try to have multiple authentication methods, especially if you involve agent-based authentication. The underlying library (ssh2) just doesn't like to play too nice in that regards. Although the library has improved it lately with a big refactor, this includes (temporary) loss of previously exposed APIs, thus making it hard to port right now.

As for VS Code only supporting one password prompt, that's something I didn't know. If that's (still) the case and causes issues, I could make the extension queue up password prompts.

Disclaimer: I am the developer of the SSH FS extension

Kelvin Schoofs
  • 8,323
  • 1
  • 12
  • 31