Accessing VMs with SSH

You can use a secure shell (SSH) connection to remotely access a Linux VM running in Skytap Cloud.

An SSH connection requires:

  • An open SSH port (port 22) on the VM network adapter
  • Configuration of the VM guest operating system to support SSH access

Once you’ve configured the VM for access, use a terminal emulation client (such as Putty) or an SSH client to connect to the VM.

Contents

Configuring a VM for SSH access

To configure a VM for SSH access
  1. Within Skytap Cloud, open SSH port (port 22) on the VM network adapter
    • Create a published service for SSH Server (port 22).

      This allows access to port 22 on the VM over the public Internet.

      or

    • Use an existing public IP address or VPN connection.

      • If a public IP address is attached to the VM, Skytap Cloud allows connections from the public Internet to the VM on all ports.
      • If the VM is connected to a VPN, Skytap Cloud allows connections from the VPN to the VM on all ports.
  2. Configure the VM guest operating system to support SSH access. The steps vary, depending on the guest operating system. Generally, you need to:

    • Verify that port 22 is open on the VM operating system firewall.
    • Install and run an SSH server.

      1. Install open SSH:
         sudo apt-get install openssh-server
        
      2. Confirm that SSH daemon (sshd) is running:
         ps -aef | grep sshd
        
      3. Try to connect:
         ssh localhost
        
  3. (Optional, but recommended) Set a strong password for any user accounts on the VM. The steps vary, depending on the guest operating system.

Connecting via SSH

To connect to the running VM
  1. Locate the address of the SSH service

    Port opening type Address format
    Public IP address attached to VM <public-ip-address>:22
    For example: 128.128.128.128:22
    VM attached to a VPN <vm-ip-address>:22 or <vm-nat-ip-address>:22 (if the VPN is NAT-enabled)
    For example, 10.0.0.1:22
    Published service <public-address-of-published-service>
    For example: services-apac.cloud.skytap.com:24908
    (For help, see Adding a published service to a VM)
  2. Use the address in a terminal emulation client (such as Putty) or use the following command line to access the VM directly from your desktop SSH client:
  3.  ssh -p <port> user@<ip-address-or-hostname>
    

    Public IP address example: ssh -p 22 user@128.128.128.128

    Published service example: ssh -p 24908 user@services-apac.cloud.skytap.com