-
Notifications
You must be signed in to change notification settings - Fork 1
Configuring SSH targets
Currently SSH targets are supported by the extension. The SSH targets are sourced from a standard SSH configuration file. In the extension configuration the user can specify the location of the SSH config file, which defaults to ~/.ssh/config

The most convenient way of accessing the remote devices is to set up key based authentication. If you have an existing key, that you want to use, then start from step 2.
To generate an ssh key, use the ssh-keygen utility. The tool will prompt for the location of the keys to be saved. For this step by step, let's say you inputted ~/.ssh/id_rsa_device1. Two files will be generated: a private and a public key. The public key has the same basename but .pub extension.
In order to be able to use public key authentication the following has to be true:
- Key based authentication is enabled on the target device (
/etc/ssh/sshd_config) (NB: usually, already enabled) - The public key is installed in the SSH login user's
authorized_keysfile.(NB: see detailed article) - The most convenient way is to use the
ssh-copy-idutility, e.g:ssh-copy-id -i ~/.ssh/id_rsa_device1 user@target
Normally the identity file and user would be required to specified all times when one wants to ssh into a host. This can be relaxed by adding an SSH config. Add an entry for you new device in your designated ssh config file (e.g. ~/.ssh/config):
Host myhost
HostName 192.168.0.1 # By IP
#HostName er-edge-231415.local # or by DNS
User admin # specify username to be used
IdentityFile ~/.ssh/id_rsa_device1 # specify location of private keyIf all is set up correctly, passwordless login should work from a terminal as well, by executing ssh myhost.
In order to reload the specified ssh config, the reload button must be used in the dev explorer

To verify operation, try to open a terminal from VSCode using the ERDev extension
