Skip to content

Commit ec662ee

Browse files
Merge pull request #10034 from msaenzbosupport/patch-43
AB#8037: Refactor SSH connection troubleshooting instructions
2 parents d6afd34 + 63a8685 commit ec662ee

File tree

1 file changed

+5
-32
lines changed

1 file changed

+5
-32
lines changed

support/azure/virtual-machines/linux/troubleshoot-ssh-connection.md

Lines changed: 5 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,11 @@ az vm user update --resource-group myResourceGroup --name myVM \
185185
--username myUsername --password myPassword
186186
```
187187

188-
If using SSH key authentication, you can reset the SSH key for a given user. The following example uses **az vm access set-linux-user** to update the SSH key stored in `~/.ssh/id_rsa.pub` for the user named `myUsername`, on the VM named `myVM` in `myResourceGroup`. Use your own values as follows:
188+
If using SSH key authentication, you can reset the SSH key for a given user. The following example uses **az vm user update** to update the SSH key stored in `~/.ssh/id_rsa.pub` for the user named `myUsername`, on the VM named `myVM` in `myResourceGroup`. Use your own values as follows:
189189

190190
```azurecli
191191
az vm user update --resource-group myResourceGroup --name myVM \
192-
--username myUsername --ssh-key-value ~/.ssh/id_rsa.pub
192+
--username myUsername --ssh-key-value "$(cat ~/.ssh/id_rsa.pub)"
193193
```
194194

195195
## Use the VMAccess extension
@@ -202,7 +202,7 @@ Create a file named `settings.json` with the following content:
202202

203203
```json
204204
{
205-
"reset_ssh":True
205+
"reset_ssh": true
206206
}
207207
```
208208

@@ -213,9 +213,9 @@ az vm extension set --resource-group philmea --vm-name Ubuntu \
213213
--name VMAccessForLinux --publisher Microsoft.OSTCExtensions --version 1.2 --settings settings.json
214214
```
215215

216-
### Reset SSH credentials for a user
216+
### Reset SSH credentials for a user.
217217

218-
If SSHD appears to function correctly, you can reset the credentials for a giver user. To reset the password for a user, create a file named `settings.json`. The following example resets the credentials for `myUsername` to the value specified in `myPassword`. Enter the following lines into your `settings.json` file, using your own values:
218+
If SSHD appears to function correctly, you can reset the credentials for a given user. To reset the password for a user, create a file named `settings.json`. The following example resets the credentials for `myUsername` to the value specified in `myPassword`. Enter the following lines into your `settings.json` file, using your own values:
219219

220220
```json
221221
{
@@ -238,33 +238,6 @@ az vm extension set --resource-group philmea --vm-name Ubuntu \
238238
--name VMAccessForLinux --publisher Microsoft.OSTCExtensions --version 1.2 --settings settings.json
239239
```
240240

241-
### Reset SSH configuration
242-
243-
The SSHD configuration itself may be misconfigured or the service encountered an error. You can reset SSHD to make sure the SSH configuration itself is valid. Resetting SSHD should be the first troubleshooting step you take.
244-
245-
The following example resets SSHD on a VM named `myVM` in the resource group named `myResourceGroup`. Use your own VM and resource group names as follows:
246-
247-
```azurecli
248-
azure vm reset-access --resource-group myResourceGroup --name myVM \
249-
--reset-ssh
250-
```
251-
252-
### Reset SSH credentials for a user
253-
254-
If SSHD appears to function correctly, you can reset the password for a giver user. The following example resets the credentials for `myUsername` to the value specified in `myPassword`, on the VM named `myVM` in `myResourceGroup`. Use your own values as follows:
255-
256-
```azurecli
257-
azure vm reset-access --resource-group myResourceGroup --name myVM \
258-
--user-name myUsername --password myPassword
259-
```
260-
261-
If using SSH key authentication, you can reset the SSH key for a given user. The following example updates the SSH key stored in `~/.ssh/id_rsa.pub` for the user named `myUsername`, on the VM named `myVM` in `myResourceGroup`. Use your own values as follows:
262-
263-
```azurecli
264-
azure vm reset-access --resource-group myResourceGroup --name myVM \
265-
--user-name myUsername --ssh-key-file ~/.ssh/id_rsa.pub
266-
```
267-
268241
## Restart a VM
269242

270243
If you have reset the SSH configuration and user credentials, or encountered an error in doing so, you can try restarting the VM to address underlying compute issues.

0 commit comments

Comments
 (0)