Search code examples
azuresshazure-resource-group

Azure: How to ssh to a vm in a resource group with several ubuntu vms


I've created a resource group with several ubuntu vms. I've used the preconfigured vm provided on azure. The group is up. I can see it's tile with vm scale set, load balancer and public ip address. Yet, I don't know how to shh to individual machines in the group? I can only see the ip address of the group (cannot ssh to it).


Solution

  • To ssh to individual machines one needs to specify a port which can be found in the “Inbound NAT rules” under Settings. For example if the port for one of the VMs is 50001 then:

    ssh -p 50001 -l username IPofVMset
    

    The IP address of the VM set is dynamic (after each restart of the VM set it is different), but there should also be a static DNS name in the azure domain.

    PS. Note that for scp the switch for providing port number is -P (capital) rather -p.