Azure / Azure/azure-cli

Feature request - simplify SSH login and SCP

Open
#5,622 3 comments 9 reactions 1 assignee Claimed by @qwordy View on GitHub
act-observability-squad Compute feature-request
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

# Situation
Currently, if you want to ssh into a VM; you first need to grab the VMs IP address, and then use your built-in SSH to login to the VM. You also need to manage SSH keys for your VMs yourself.

# **Feature request:**
Ability to SSH into a VM straight from CLI like:

```
az vm ssh -n myawesomevm
```

Ability to SCP a file into a VM from the CLI like:
```
az vm scp -n myawesomevm --local-file /home/user/file.txt
```
With the ability for az cli to be configurable as to which keys will be used:
```
az configure --defaults private-key='~/.ssh/myprivate.key'
```

# **Constraints/complexity**
I've been thinking about this and reflected on the following complexities:

- **Public/Private IP**: az CLI should be intelligent enough to use public IP if available or revert to private IP if there is no public IP.
- **Key management**: typically ssh keys are stored in the .ssh directory. Az CLI will need to have configurability as to which keys are being used. Potential integration with Key Vault would be great nice to have.
- **Linux/Windows**: SSH is Linux native, typical SSH usage on Windows is using Putty, although OpenSSH has been ported to [Win32](https://github.com/PowerShell/Win32-OpenSSH).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.