Prepare custom ssh config
In home dir ~/.ssh/config copy to ~/.ssh/config_vscode:
|
|
For work as differnet system user from sudo user workuser add remote command to ~/.ssh/config_vscode
MacOS or Linux
|
|
Full ssh config
|
|
Windows
|
|
Full ssh config
|
|
Configure Visual Studio Code
Open Visual Studio Code user settings.json file, set custom ssh config and enableRemoteCommand to true.
|
|
Check defaultSettings.json is set useLocalServer to true
|
|
Connect to host as sudo user
In Visual Studio Code open Connect to host: Remote-SSH with preconfigured ssh host srv01.internal