VitalyKondratiev / vscode-sshextension

Extension for SSH connections using the ftp-simple settings
MIT License
21 stars 11 forks source link
ssh-connection vscode-extension

About SSHExtension

Join the chat at https://gitter.im/Vitalykondratiev/vscode-sshextension

Latest Release Installs

This extension allows you to open an SSH connection in the integrated terminal. The extension was created in order to have access to the SSH in conjunction with the already available access to the FTP.

Features

You can use configurations from another extensions (e.g. ftp-simple)
The connection opens in a new instance of the integrated terminal.
SSH port forwarding.

How to use

Open terminal from server list

Demo Open connection from list

Fast open terminal

Demo Open connection from list

SSH port forwarding

Demo Open connection from list

To add a server, see Settings section.

Requirements

You should still have an ssh agent, not necessarily that it is available in the entire system. it is important that it is accessible from the integrated VSCode terminal.

Settings (for servers)

You can use ready-made config file from this extensions (if you use):

Or you can use extension settings simply add sshextension.serverList directive.

Extension settings

sshextension.serverList

You can describe servers config in this parameter as array of objects.
Server object parameters:

For example:

{
    "sshextension.serverList": [
        {
            "name": "Example server",
            "host": "example.com",
            "port": 22,
            "username": "user",
            "privateKey": "D:\\id_rsa",
            "project": {
                "D:/projects/project": "/home/user/project",
                "D:/projects/yet_another_project": "/home/user/yet_another_project"
            },
            "path": "/",
            "customCommands": [
              "pwd"
            ]
        },
        ...
    ]
}

sshextension.customCommands

Specifies custom commands which will execute on session start.
For example:

{
  "sshextension.customCommands": [
    "pwd",
    "ls"
  ]
}

Demo Custom commands

sshextension.openProjectCatalog

Open the project directory from the ftp-simple config, if it exists, after starting the SSH session.
For example:

{
  "sshextension.openProjectCatalog": true
}

sshextension.recentlyUsedForwardings

In this place stored all saved port forwarding args. You can save the arguments for port forwarding, which you often use.
For example:

{
  "sshextension.recentlyUsedForwardings": [
    "-R 9000:localhost:9000"
  ]
}

sshextension.allowMultipleConnections

Allow you open few connections for one server at the same time.
For example:

{
  "sshextension.allowMultipleConnections": true
}

sshextension.showHostsInPickLists

Show usernames and hosthames in pick lists instead on server names.
For example:

{
  "sshextension.showHostsInPickLists": true
}

Roadmap

Add the ability to work with an external terminal.
Open SSH connections in Putty.
And a few more secret (before their release) features... ).

Special thanks

eduardbadillo
Added ability to use different port in ssh connections (pull request merged in version 0.1.2)

Feedback

I want to make a really useful extension, if you find a bug, please create an issue at github.
If you have suggestions to the functional, then write to the same.
And also if it's not difficult for you, leave a comment in the marketplace.