![]() ![]() Set the user and hostname in the connection information text box. ![]() For the hostname, go back to the Azure portal and in the Overview pane of the VM we created, copy the Public IP address. ![]() Click on the indicator to bring up a list of Remote extension commands.Ĭhoose the Remote-SSH: Connect to Host command and connect to the host by entering connection information for your VM in the following format: user is the username you set when adding the SSH public key to your VM. This indicator tells you in which context VS Code is running (local or remote). You'll have noticed an indicator on the bottom-left corner of the Status bar. If you don't already have the Remote - SSH extension installed, you can search for "remote ssh" in the Extensions view (Ctrl + Shift + X). The VS Code Remote - SSH extension allows you to connect to a remote machine or VM using SSH, all from inside VS Code. Now that we've covered how to create an SSH host, let's connect to it! Select Review and Create and Azure will deploy your VM for you! Connect using Remote - SSH If you go to the Management tab, you can set the time you want to shut down the VM daily. You also want to allow your VM to accept inbound SSH traffic.Ī cool feature of using Azure VMs is the ability to enable auto-shutdown (because let's face it, we all forget to turn off our VMs…). We'll take the public key and paste it into our VM setup, by copying the contents of the id_ed25519.pub. In the previous step, we generated an SSH key pair. You will then be prompted to enter a secure passphrase but you can leave that blank. Press Enter at the following prompt to save the key in the default location. If you don't have an SSH key pair, open a bash shell or the command line and type in: ssh-keygen -t ed25519 If you're on Windows and have already created keys using PuttyGen, you can reuse them. We strongly recommend using key-based authentication so you do not need to enter your password each time you connect. There are several authentication methods into a VM, including an SSH public/private key pair or a username and password. We will choose Ubuntu Server 18.04 LTS for this example, but you can choose recent versions of other Linux distros and look at our supported SSH servers. Now you can specify details of your VM, such as the name, the size of, and the base image. From there, you can select your Azure subscription and create a new resource group, if you don't already have one. In the Azure portal, search for "Virtual Machines", and choose Add. If you don't have an existing Linux virtual machine, you can create a new VM through the Azure portal.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |