Skip to content

Commit

Permalink
Revert "Connect to Arc Servers" (#3956)
Browse files Browse the repository at this point in the history
* Revert "Connect to Arc Servers (#3929)"

This reverts commit 78264f6.

* Updated to version 0.1.8 and updated history notes

* Fixed typo

* Fixed another typo

* Change in history
  • Loading branch information
vthiebaut10 authored Oct 14, 2021
1 parent 86680f7 commit b4ac83a
Show file tree
Hide file tree
Showing 41 changed files with 163 additions and 10,363 deletions.
5 changes: 0 additions & 5 deletions linter_exclusions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2120,11 +2120,6 @@ ssh vm:
ssh_args:
rule_exclusions:
- no_positional_parameters
ssh arc:
parameters:
ssh_args:
rule_exclusions:
- no_positional_parameters
storage account create:
parameters:
hierarchical_namespace:
Expand Down
10 changes: 6 additions & 4 deletions src/ssh/HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
Release History
===============
0.1.8
-----
* Rollback from version 0.1.7 to 0.1.6 to remove preview features.

0.1.7
-----
* Add support for connecting to Arc Servers using AAD issued certificates.
* Add support for connecting to local users on Azure VMs and Arc Server using certs-based, key-based, and password-based authentication
* Add --ssh-client-path, --resource-id, --local-user, --cert-file, and --delete-privkey arguments.
* Introduced preview features.

0.1.6
-----
Expand Down Expand Up @@ -47,4 +49,4 @@ Release History

0.1.0
-----
* Initial release.
* Initial release.
36 changes: 0 additions & 36 deletions src/ssh/azext_ssh/_client_factory.py

This file was deleted.

48 changes: 5 additions & 43 deletions src/ssh/azext_ssh/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,17 @@

helps['ssh'] = """
type: group
short-summary: SSH into resources (Azure VMs, Arc servers, etc) using AAD issued openssh certificates.
short-summary: SSH into resources (Azure VMs, etc) using AAD issued openssh certificates
"""

helps['ssh vm'] = """
type: command
short-summary: SSH into Azure VMs or Arc Servers.
long-summary: Users can now login using AAD issued certificates or using local user credentials. We recommend login using AAD issued certificates as azure automatically rotate SSH CA keys. To SSH as a local user in the target machine, you must provide the local user name using the --local-user argument.
short-summary: SSH into Azure VMs using an ssh certificate
examples:
- name: Give a resource group and VM to SSH using AAD issued certificates
- name: Give a resource group and VM to SSH to
text: |
az ssh vm --resource-group myResourceGroup --vm-name myVM
- name: Give the public IP (or hostname) of a VM to SSH to SSH using AAD issued certificates
az ssh vm --resource-group myResourceGroup --vm-name myVm
- name: Give the public IP (or hostname) of a VM to SSH to
text: |
az ssh vm --ip 1.2.3.4
az ssh vm --hostname example.com
Expand All @@ -28,18 +27,6 @@
- name: Using additional ssh arguments
text: |
az ssh vm --ip 1.2.3.4 -- -A -o ForwardX11=yes
- name: Give the Resource ID of a VM to SSH using AAD issued certificates. Using the resource ID to identify the target machine is useful when there is an Azure VM and a Arc Server with the same name in the same resource group.
text: |
az ssh vm --resource-id /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.Compute/virtualMachines/myVM
- name: Give a local user name to SSH using local user credentials on the target machine using certificate based authentication.
text: |
az ssh vm --local-user username --ip 1.2.3.4 --certificate-file cert.pub --private-key key
- name: Give a local user name to SSH using local user credentials on the target machine using key based authentication.
text: |
az ssh vm --local-user username --resource-group myResourceGroup --vm-name myVM --private-key-file key
- name: Give a local user name to SSH using local user credentials on the target machine using password based authentication.
text: |
az ssh vm --local-user username --resource-id /subscriptions/mySubsription/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/machines/myArcServer
"""

helps['ssh config'] = """
Expand Down Expand Up @@ -76,28 +63,3 @@
text: |
az ssh cert --public-key-file ./id_rsa.pub --file ./id_rsa-aadcert.pub
"""

helps['ssh arc'] = """
type: command
short-summary: SSH into Azure Arc Servers
long-summary: Users can now login using AAD issued certificates or using local user credentials. We recommend login using AAD issued certificates as azure automatically rotate SSH CA keys. To SSH as a local user in the target machine, you must provide the local user name using the --local-user argument.
examples:
- name: Give a resource group and Arc Server Name to SSH using AAD issued certificates
text: |
az ssh arc --resource-group myResourceGroup --vm-name myArcServer
- name: Give the Resource ID of an Arc Server to SSH using AAD issued certificates
text: |
az ssh arc --resource-id /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.HybridCompute/machines/myArcServer
- name: Using a custom private key file
text: |
az ssh arc --resource-group myResourceGroup --vm-name myArcServer --private-key-file key --public-key-file key.pub
- name: Give a local user name to SSH to a local user using certificate-based authentication
text: |
az ssh arc --resource-group myResourceGroup --vm-name myArcServer --certificate-file cert.pub --private-key key --local-user name
- name: Give a local user name to SSH to a local user using key-based authentication
text: |
az ssh arc --resource-group myRG --vm-name myVM --local-user name --private-key-file key
- name: Give a local user name to SSH to a local user using password-based authentication
text: |
az ssh arc --resource-id /subscriptions/mySubsription/resourceGroups/myRG/providers/Microsoft.HybridCompute/machines/myArcServer --local-user username
"""
33 changes: 0 additions & 33 deletions src/ssh/azext_ssh/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,58 +10,25 @@ def load_arguments(self, _):
c.argument('vm_name', options_list=['--vm-name', '--name', '-n'], help='The name of the VM')
c.argument('ssh_ip', options_list=['--ip', '--hostname'],
help='The public (or reachable private) IP address (or hostname) of the VM')
c.argument('resource_id', options_list=['--resource-id'], help='The Resource ID of the Azure VM or Arc Server')
c.argument('public_key_file', options_list=['--public-key-file', '-p'], help='The RSA public key file path')
c.argument('private_key_file', options_list=['--private-key-file', '-i'], help='The RSA private key file path')
c.argument('use_private_ip', options_list=['--prefer-private-ip'],
help='Will prefer private IP. Requires connectivity to the private IP.')
c.argument('local_user', options_list=['--local-user'],
help='The username for a local user')
c.argument('cert_file', options_list=['--certificate-file', '-c'],
help='Path to a certificate file used for authentication when using local user credentials.')
c.argument('port', options_list=['--port'], help='SSH port')
c.argument('ssh_client_path', options_list=['--ssh-client-path'],
help='Path to ssh executable. Default to ssh pre-installed if not provided.')
c.argument('delete_privkey', options_list=['--delete-private-key'],
help=('This is an internal argument. This argument is used by Azure Portal to provide a one click '
'SSH login experience in Cloud shell.'),
deprecate_info=c.deprecate(hide=True), action='store_true')
c.positional('ssh_args', nargs='*', help='Additional arguments passed to OpenSSH')

with self.argument_context('ssh config') as c:
c.argument('config_path', options_list=['--file', '-f'], help='The file path to write the SSH config to')
c.argument('vm_name', options_list=['--vm-name', '--name', '-n'], help='The name of the VM')
c.argument('ssh_ip', options_list=['--ip'], help='The public IP address (or hostname) of the VM')
c.argument('resource_id', options_list=['--resource-id'], help='The Resource ID of the Azure VM or Arc Server')
c.argument('public_key_file', options_list=['--public-key-file', '-p'], help='The RSA public key file path')
c.argument('private_key_file', options_list=['--private-key-file', '-i'], help='The RSA private key file path')
c.argument('use_private_ip', options_list=['--prefer-private-ip'],
help='Will use a private IP if available. By default only public IPs are used.')
c.argument('local_user', options_list=['--local-user'],
help='The username for a local user')
c.argument('overwrite', action='store_true', options_list=['--overwrite'],
help='Overwrites the config file if this flag is set')
c.argument('port', options_list=['--port'], help='Port to connect to on the remote host.')
c.argument('cert_file', options_list=['--certificate-file', '-c'], help='Path to certificate file')

with self.argument_context('ssh cert') as c:
c.argument('cert_path', options_list=['--file', '-f'],
help='The file path to write the SSH cert to, defaults to public key path with -aadcert.pub appened')
c.argument('public_key_file', options_list=['--public-key-file', '-p'], help='The RSA public key file path')

with self.argument_context('ssh arc') as c:
c.argument('vm_name', options_list=['--vm-name', '--name', '-n'], help='The name of the Arc Server')
c.argument('public_key_file', options_list=['--public-key-file', '-p'], help='The RSA public key file path')
c.argument('private_key_file', options_list=['--private-key-file', '-i'], help='The RSA private key file path')
c.argument('local_user', options_list=['--local-user'],
help='The username for a local user')
c.argument('cert_file', options_list=['--certificate-file', '-c'], help='Path to certificate file')
c.argument('resource_id', options_list=['--resource-id'], help='The Resource ID of the Arc Server')
c.argument('port', options_list=['--port'], help='Port to connect to on the remote host.')
c.argument('ssh_client_path', options_list=['--ssh-client-path'],
help='Path to ssh executable. Default to ssh pre-installed if not provided.')
c.argument('delete_privkey', options_list=['--delete-private-key'],
help=('This is an internal argument. This argument is used by Azure Portal to provide a one click '
'SSH login experience in Cloud shell.'),
deprecate_info=c.deprecate(hide=True), action='store_true')
c.positional('ssh_args', nargs='*', help='Additional arguments passed to OpenSSH')
1 change: 0 additions & 1 deletion src/ssh/azext_ssh/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ def load_command_table(self, _):
g.custom_command('vm', 'ssh_vm')
g.custom_command('config', 'ssh_config')
g.custom_command('cert', 'ssh_cert')
g.custom_command('arc', 'ssh_arc')
10 changes: 0 additions & 10 deletions src/ssh/azext_ssh/constants.py

This file was deleted.

Loading

0 comments on commit b4ac83a

Please sign in to comment.