Skip to content

Commit b73d6c6

Browse files
TylerMSFTTylerMSFT
andauthored
add sample connection properties (#4173)
* add sample connection properties * add examples * alphabetize list * break the examples out into their own section * adjust examples * update wording * more changes to example section and remove a little redundancy * acrolinx * tech review * acrolinx * change location of troubleshooting step * wording * removed connection id Co-authored-by: TylerMSFT <[email protected]>
1 parent 04f6ae9 commit b73d6c6

File tree

2 files changed

+73
-42
lines changed

2 files changed

+73
-42
lines changed

docs/linux/connect-to-your-remote-linux-computer.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Connect to your target Linux system in Visual Studio"
33
description: "How to connect to a remote Linux machine or Windows Subsystem for Linux from inside a Visual Studio C++ project."
4-
ms.date: "01/8/2021"
4+
ms.date: 03/14/2022
55
---
66
# Connect to your target Linux system in Visual Studio
77

@@ -94,6 +94,8 @@ If `ssh` isn't already set up and running on your Linux system, follow these ste
9494

9595
If you use key files for authentication, make sure the target machine's SSH server is running and configured properly.
9696

97+
If you have trouble connecting to WSL on `localhost`, see [Fix WSL `localhost` connection problems](#fix-wsl-localhost-connection-problems).
98+
9799
::: moniker-end
98100

99101
::: moniker range=">=msvc-160"
@@ -229,6 +231,25 @@ To configure your WSL installation to work with Visual Studio, you need the foll
229231
sudo apt install g++ gdb make ninja-build rsync zip
230232
```
231233

234+
### Fix WSL `localhost` connection problems
235+
236+
When connecting to Windows Subsystem for Linux (WSL) on `localhost`, you may run into a conflict with the Windows `ssh` client on port 22. In WSL, change the port that `ssh`expects requests from to 23 in `/etc/ssh/sshd_config`:
237+
238+
```bash
239+
Port 23
240+
```
241+
242+
If you're connecting using a password, ensure that the following is set in `/etc/ssh/sshd_config`:
243+
244+
```bash
245+
# To disable tunneled clear text passwords, change to no here!
246+
PasswordAuthentication yes
247+
```
248+
249+
After making these changes, restart the SSH server (`sudo service ssh restart` on Ubuntu).
250+
251+
Then retry your connection to `localhost` using port 23.
252+
232253
For more information, see [Download, install, and set up the Linux workload](download-install-and-setup-the-linux-development-workload.md).
233254

234255
To configure an MSBuild project for WSL, see [Configure a Linux project](configure-a-linux-project.md). To configure a CMake project for WSL, see [Configure a Linux CMake project](cmake-linux-project.md). To follow step-by-step instructions for creating a simple console application with WSL, check out this introductory blog post on [C++ with Visual Studio 2019 and the Windows Subsystem for Linux (WSL)](https://devblogs.microsoft.com/cppblog/c-with-visual-studio-2019-and-windows-subsystem-for-linux-wsl/).

docs/linux/connectionmanager-reference.md

Lines changed: 51 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "ConnectionManager reference"
3-
description: "How to manage your remote SSH connections from a command-line tool."
4-
ms.date: "10/7/2020"
3+
description: "How to manage your remote SSH connections from the command-line tool ConnectionManager.exe."
4+
ms.date: 03/14/2022
55
f1_keywords: ["ConnectionManager"]
66
helpviewer_keywords: ["ConnectionManager program"]
77
---
@@ -31,82 +31,82 @@ The functionality of ConnectionManager.exe is also available in Visual Studio. T
3131

3232
Authenticates and adds a new connection. By default, it uses port 22 and password authentication. (You'll be prompted to enter a password.) Use both **-`-password`** and **`--privatekey`** to specify a password for a private key.
3333

34-
- **`remove`** \[*connection_id* \| *user\@host* \[**`--port`** *port*]]
34+
- **`clean`**
35+
36+
Deletes header cache for connections that no longer exist.
37+
38+
- **`help`**
39+
40+
Displays a help screen.
41+
42+
- **`list`** \[**`--properties`**]
43+
44+
Displays information, IDs, and properties of all stored connections.<br>For examples, see [Commonly used properties](#commonly-used-properties).
3545

36-
Removes a connection. If no arguments are specified, you're prompted to specify which connection to remove.
37-
3846
- **`modify`** \[*default* \| *connection_id* \| *user\@host* \[**`--port`** *port*]] \[**`--property`** *key=value*]
3947

4048
Defines or modifies a property on a connection.\
4149
If *value* is empty, then the property *key* is deleted.\
4250
If authentication fails, no changes will be made.\
4351
If no connection is specified (what is meant by *default*, above), the user's default remote connection is used.
4452

45-
- **`remove-all`**
46-
47-
Removes all stored connections.
48-
49-
- **`clean`**
50-
51-
Deletes header cache for connections that no longer exist.
53+
- **`remove`** \[*connection_id* \| *user\@host* \[**`--port`** *port*]]
5254

53-
- **`list`** \[**`--properties`**]
55+
Removes a connection. If no arguments are specified, you're prompted to specify which connection to remove.
5456

55-
Displays information, IDs, and properties of all stored connections.
57+
- **`remove-all`**
5658

57-
- **`help`**
59+
Removes all stored connections.
60+
61+
- **`update`** \[*default* \| *all* \| *connection_id* \| *user\@host* \[**`--port`** *port*]] \[**`--previous`**] [**`--fingerprint`**]
5862

59-
Displays a help screen.
63+
Added in Visual Studio 16.10. Updates the host key fingerprint of the specified connection(s).
6064

6165
- **`version`**
6266

6367
Displays version information.
64-
65-
- **`update`** \[*default* \| *all* \| *connection_id* \| *user\@host* \[**`--port`** *port*]] \[**`--previous`**] [**`--fingerprint`**]
66-
67-
Added in Visual Studio 16.10. Updates the host key fingerprint of the specified connection(s).
6868

6969
### Options
7070

71-
- **`-q`**, **`--quiet`**
71+
- **`--file`** *filename*
7272

73-
Prevents output to `stdout` or `stderr`.
73+
Read connection information from the provided *filename*.
7474

75-
- **`--no-prompt`**
75+
- **`--fingerprint`**
7676

77-
Fail instead of prompt, when appropriate.
77+
The host key fingerprint presented by the server. Use this option with **`list`** to view a connection's fingerprint.
7878

79-
- **`--no-verify`**
79+
- **`-i`**
8080

81-
Add or modify a connection without authentication.
81+
Same as **`--privatekey`**.
8282

83-
- **`--file`** *filename*
83+
- **`-n`**, **`--dry-run`**
8484

85-
Read connection information from the provided *filename*.
85+
Does a dry run of the command.
86+
87+
- **`--no-prompt`**
88+
89+
Fail instead of prompt, when appropriate.
8690

8791
- **`--no-telemetry`**
8892

8993
Disable sending usage data back to Microsoft. Usage data is collected and sent back to Microsoft unless the **`--no-telemetry`** flag is passed.
9094

91-
- **`-n`**, **`--dry-run`**
95+
- **`--no-verify`**
9296

93-
Does a dry run of the command.
97+
Add or modify a connection without authentication.
9498

9599
- **`--p`**
96100

97101
Same as **`--password`**.
98-
99-
- **`-i`**
100-
101-
Same as **`--privatekey`**.
102102

103103
- **`--previous`**
104104

105105
Indicates that the connection(s) will be read from the previous version of connection manager, updated, and written to the new version.
106106

107-
- **`--fingerprint`**
107+
- **`-q`**, **`--quiet`**
108108

109-
The host key fingerprint presented by the server. Use this option with **`list`** to view a connection's fingerprint.
109+
Prevents output to `stdout` or `stderr`.
110110

111111
## Examples
112112

@@ -122,11 +122,21 @@ This command removes the connection that has ID 1975957870 from the list of conn
122122
ConnectionManager.exe remove 1975957870
123123
```
124124

125-
This command overrides the choice of shell for the connection with connection ID 21212121. Supported shells are: **`sh, csh, bash, tcsh, ksh, zsh, dash`**. If the shell found on the Linux system isn't supported, then we fall back to explicitly use **`sh`** for all commands.
126-
127-
```cmd
128-
ConnectionManager.exe modify 21212121 --property shell=csh
129-
```
125+
### Commonly used properties
126+
127+
| Property | Description |
128+
|--|--|
129+
| authentication type | The type of authentication used for the connection such as: `"password"`, `"privatekey"`.<br/>To create a connection with the authentication type set to `"privatekey"`: `ConnectionManager.exe add [email protected] --privatekey "%USERPROFILE%\.ssh\id_rsa"`|
130+
| `default` | A boolean indicating whether this is the default connection. The default connection is used when there's more than one connection available and the one to use isn't specified.<br/>To set the specified connection to be the default connection: `ConnectionManager.exe modify -21212121 --property default=true` |
131+
| `host` | The name or IP address of the remote computer.<br/>To change the host for the specified connection to another machine, in this case, local host: `ConnectionManager.exe modify -21212121 --property host=127.0.0.1` |
132+
| `isWsl` | Returns true if the remote session is running Windows Subsystem for Linux. |
133+
| `password` | The password for the connection. Change the password for the specified connection with: `ConnectionManager.exe modify -21212121 --property password="xyz"`|
134+
| `platform` | The platform of the remote computer such as `"ARM"`, `"ARM64"`, `"PPC"`, `"PPC64"`, `"x64"`, `"x86"`.|
135+
| `port` | The port used for the connection.<br/>Change the port for the specified connection: `ConnectionManager.exe modify -21212121 --property port=22`|
136+
| `shell` | The preferred shell to use on the remote system. Supported shells are `sh, csh, bash, tcsh, ksh, zsh, dash`<br/>To set the preferred shell to be zsh for the remote machine on the specified connection: `ConnectionManager.exe modify -21212121 --property shell=zsh`<br/>If the shell found on the Linux system isn't supported, then **`sh`** is used for all commands. |
137+
| `systemID` | The remote system type, such as `"OSX"`, `"Ubuntu"`. |
138+
| `timeout` | The connection timeout in milliseconds. Change the timeout for the specified connection with: `ConnectionManager.exe modify -21212121 --property timeout=100`
139+
| `username` | The name of the user logged into the remote computer.<br/>To add a connection for a user named `"user"` on localhost: `ConnectionManager.exe add [email protected]`|
130140

131141
## See also
132142

0 commit comments

Comments
 (0)