Guides

Cloud Computing - Creating Linux instances without key pair

How to create Cloud instances with Linux o. s. without using keypair

To connect securely to a Linux Cloud instance you should always use an authentication system with key pair as described in the Creating Linux Cloud Instances with keypair guide. However, it is also possible to connect without ke ypair - therefore, not securely - with the following procedure.

Log in to the ServerMate control panel, open the Cloud Computing section and then click on the Crea Nuova Istanza icon.

Choose the Linux Choose the preferred, click on the Crea Istanza button. Indicate the name to be assigned to the instance, check the Security Groups desired and choose a Flavor (Silver, Gold, Platinum); the Keypair list must not be modified, so leave the default choice Seleziona una keypair unchanged.

The Crea Istanza button starts the activation of the instance by the Hosting Solutions cloud computing platform. At the end of the procedure, the instance without key pair will be visible in the Cloud Computing section.

If a key pair is not available, you can connect to the instance via the VNC console, using the access credentials in the log file. To retrieve them, click on theAzioni button and select Vedi LOG.

In the case of Ubuntu, the user name to use is ubuntu (with the other distributions it is root).
The password is an alphanumeric combination that changes each time the machine is restarted (ubuntu user temporary password)..
Write down the password and launch the VNC console from the instance's Azioni menu.

enter your access credentials in the console , and confirm them with the ENTER key on your keyboard (if the console is not active, click on the title bar of the window).

SSH access and change of password

NOTE: All commands must be executed with root privileges.

Access to the machine using the VNC console may not be optimal in terms of performance and functionality; however, it is possible to enable ssh access using a username and password. o do this, switch to the root user (sudo -s) and edit the sshd_config file with an editor; for example:

vi /etc/ssh/sshd_config 

Change the Password Authentication parameter from no to yes, as shown in the following image.

Restart the ssh service o record the changes, using the following instruction.

service ssh restart

In this way it is possible to connect to the instance remotely via an SSH client (e.g. openSSH for Linux clients Putty for Windows clients) by specifying the username, the instance's public IP and the password contained in the log. For example, the command to launch from a Linux client could be.

ssh ubuntu@89.31.XX.XX

It is also possible to choose a personal password, different from the one generated randomly each time the machine is restarted. To do this, first disable the automatic password generation service, by typing:

update-rc.d randpass disable

Then change the ubuntu user’s password by typing:

passwd ubuntu

and entering the new preferred password.