Skip to main content

Restrict access to a VM with security groups

Keep the console open while changing access rules so you can recover if you block your SSH or Remote Desktop connection.

  1. Open the service-level Security groups page and click Create security group. Enter a SECURITY GROUP NAME and a description of its purpose.
  2. In Firewall rules, choose the PROTOCOL, PORT RANGE, IP RANGE, and TYPE. Use Inbound for connections to the VM. Enter the application port and the permitted source IP range. Keep management access limited to addresses you control.
  3. Use Add rule for other required traffic. Include the outbound access your application needs, then click Save.
  4. Open the VM's Security groups page. Select SECURITY GROUP and NETWORK INTERFACE, then click Apply security group. Check every attached group. An allow-all group still permits traffic that your new group leaves out.
  5. Check the guest firewall separately. Test a new connection from an allowed source and a connection from a source that should be denied before closing your recovery session.

If a change fails, save the error and check which groups are attached before testing access again.

Security group editor with an example SSH source addressSecurity group and interface selectors with Apply security group


Was this article helpful?

Dislike 0
Like 0
Views: 72