Skip to Content

آرشیو دسته بندی ها:Uncategorized

نصب OpenSSH در سرور Ubuntu

Install OpenSSH on Ubuntu Server quick howto


As part of the main preparation process for a Linux based vApp this article is following up with the steps on how to install OpenSSH Server on a Ubuntu Server virtual machine. Secure Shell (SSH) is a protocol which allows to connect to a Host over an unsecure network. The typical tasks include remote login, and commands executions. This is a perfect replacement for other legacy network protocols that could send passwords and other sensitive information in clear text.

The purpose of this quick article is to show the steps to install OpenSSH Server on a Ubuntu Server virtual machine. This will make the management of the server a lot easier without requiring to open any remote console or even use a remote desktop connection application. A simple SSH client like putty for example running on a Windows machine will be able to connect and manage the Ubuntu Server over a secure network connection with SSH enabled encryption.

OpenSSH runs by default on Network Port 22. Same applies to both Unix and Windows system types. If required or even for extra security it is possible to change this Port to a custom value.

OpenSSH Server can be installed as part of the main installation of the Ubuntu Server Operating System itself. Should this have been omitted or not included in any deployment scripts for unattended installations the next steps show the process to install OpenSSH Server.


How to install OpenSSH Server on Ubuntu

From the VMware vCenter Client > Virtual Machine Name > the option to run the VMware Remote console. Once the session is started and straight after the login to the Ubuntu Server the command line to install OpenSSH is pretty simple. For a non root account:

“sudo apt install -y openssh-server”

will search for the package definition into the local cache of the package manager and start the install process. Ideally a “sudo apt update” first comes handy to update the local cache with latest packages definitions. Install OpenSSH Ubuntu Server

In a matter of few seconds the step to install OpenSSH Server is complete. As the output of the installation is showing it also includes the creation of an encrypted key. This is a self-generated and not public one. Indeed, it is also possible to use an existing public one. Install OpenSSH Ubuntu Server complete

First step would be to make sure the OpenSSH Server is running. The quickest way would be to issue the command:

“sudo systemctl status ssh”

The result would look something similar to this screenshot. Install OpenSSH Ubuntu Server service status

Next in order to make OpenSSH Server start at every boot of the Ubuntu Server it is just a matter to enable the automatic start of its daemon:

“sudo systemctl enable ssh”

This command will automatically create the necessary symbolic links. Install OpenSSH Ubuntu Server enable service

At this point it is time to test the OpenSSH Server connection from a different Host. For example a Windows machine running the putty SSH client. As soon as the connection is starting (and if the encryption certificate is not “known”) the first time a new message pops up asking to review the certificate connection details. This is normal for a first time connection when using a self-generated non-public certificate. Install OpenSSH Ubuntu Server putty certificate

Upon acceptance the OpenSSH Server allows the connection and remote execution of any commands in the “local” terminal. Very useful for management and scripting purposes. Install OpenSSH Ubuntu Server windows connection

ادامه مطلب

پیکربندی Ubuntu Server 16.04.5 LTS بر روی VMware

Deploy Ubuntu Server 16.04.5 LTS on VMware


The purpose of this article is to cover the steps on how to deploy Ubuntu Server on a VMware vSphere environment. In the past the installation and deployment steps covered the Ubuntu 16.04 Desktop edition. In this case the focus is how to deploy Ubuntu Server edition and in particular the 16.04.5 release (from this branch the latest edition at the time of writing).

The idea is to create a test bed or simply a sandbox environment to use later for other projects which include the install and configuration of:

  • T.I.C.K Stack (Telegraf,InfluxDB,Chronograf and Kapacitor)
  • Grafana dashboard
  • Custom VMware vApp to deploy using OVA/OVF Templates
  • Veeam Agent for Linux
  • more

The way the guide is laid out follows the classic structure used in this blog showing different steps. Once the ISO image has been downloaded the steps are straight forward. Starting with the deployment phase it consists in creating the VM Guest container. In this sample a VM with 2 CPUs, 4 GB of RAM Memory and 2 virtual disks of 20 GB each is more than sufficient to satisfy the requirements highlighted above. The OS version is based on 64-Bit release. In general,  the idea is to create something small and light which could be used as a building block for other applications. Your mileage may vary! Before starting, it is a good time to start uploading the Ubuntu Server ISO image on the VMware Datastore. Possible the closest to the VMware Host where the Ubuntu Server VM will run.


How to deploy Ubuntu Server on VMware vSphere

Within the Data Center group or from the desired VMware vSphere Host the wizard to create a new virtual machine. This wizard will be used in two occasions: to create and customize the base Ubuntu Server virtual machine and also to export the VM into a vApp in a OVA/OVF format template. deploy Ubuntu Server VMware

In the second step of the wizard the desired name for the VM and the location in the VMware vCenter virtual infrastructure where to locate the virtual machine. deploy Ubuntu Server name VMware

Next step is to associate the vSphere Host to the virtual machine. Of course this can be changed later if required with a simple vMotion migration. It can be used for CPU, Storage and Network migration from the same wizard. deploy Ubuntu Server VMware compute resource

Next is the desired Datastore where to deploy the virtual machine disks and resources files. deploy Ubuntu Server VMware select storage

In the compatibility section unless there are specific requirements to support older versions of the virtual hardware (which also comes with less features) it is a safe option to use the latest release available which will automatically create and stamp the “vmx” file to support the latest features on the vSphere Hosts. deploy Ubuntu Server VMware select compatibility

This is the step where both the Guest OS Family and Version needs to be specified. In this example Ubuntu Linux (64-Bit) perfectly covers this scenario. deploy Ubuntu Server VMware select guest OS

This is the part where the wizard allows to further customize the virtual machine. In this example the following changes:

  • 2 CPUs
  • 4 GB Memory
  • 2 Hard Drives 20 GB each (Thin Provisioning)
  • Custom Network Port Group
  • ISO Image mounted deploy Ubuntu Server VMware customize hardware

In a final screen the wizard shows the main settings before amending changes. deploy Ubuntu Server VMware wizard summary

At this point everything is ready to commit the information and complete the wizard. Next step is about the Ubuntu Server installation.

ادامه مطلب

آموزش نصب Ubuntu Server 16.04.5 بر روی VMware

Install Ubuntu Server 16.04.5 on VMware

The steps to install Ubuntu Server are very easy. In this case the installation will occur on a VMware virtual machine. For this purpose this article follows up the steps after initial Ubuntu Server deployment. In particular this article refers to the Ubuntu Server 16.04.5 release. At the time of writing the latest from the previous stable branch.

A lightweight text based wizard guides through the entire process to install Ubuntu Server. It also includes the option to pre-install additional Server functionalities through additional package like DNS, Samba, LAMP, Mail and more. What is interesting are the options at the boot straight after the language selection. Along with traditional options to test Memory, installation source (ISO file in this case) and recover a broken system also the ability to run “special” types of install which include additional packages for:

  • HWE
  • MaaS

The former Hardware Enablement (HWE) provides the option to automatically install the latest kernel available with the latest hardware for which the drivers are already included. So no extra steps. In practice, the additional or latest kernels are made available to Ubuntu users and can be installed using the kernel package called linux-hwe-generic. This package is installed along with linux-generic for the standard kernel. HWE should be used for Dev and homelab rather than Production environments.

The latter Metal as a Service (MaaS) allows and fully automates the deployment of Physical Servers aiming to increase the Data Center operational efficiency. Generally something that is designed for DevOps at scale.

Overall to install Ubuntu Server the process is easy and the wizard provides good and intuitive information.


How to install Ubuntu Server on VMware

The VMware Remote Console is very good tool to access the virtual machine and install Ubuntu Server. After Power-on the boot displays the language to use during the text based wizard for the initial boot. Install Ubuntu Server VMware boot language

Next the option to decide on the type of installation. In this case a standard install Ubuntu Server is executed. The same ISO and wizard also provides the options to add the latest kernel packages for the latest hardware and even the option to install the MaaS Ubuntu Server. Additionally, the ability to run Memory and ISO test to make sure both are working as expected. Since this is a VM it might be also a good indicator to spot and troubleshoot undesired settings for example in the virtual BIOS. Install Ubuntu Server VMware boot menu

At this point the option to choose which language to use for the installation process. The selected one will also be used on the Ubuntu Server right after the installation. Indeed, it can be changed where required. Install Ubuntu Server VMware select language

The location settings determines the time zone and the system locale. All these settings can be changed afterwords. Install Ubuntu Server VMware select location

This is good test to verify the keyboard layout. Running a quick test is useful especially when considering to use special characters for the passwords. By choosing No the next screen allows to manually choose the keyboard layout. Install Ubuntu Server VMware configure keyboard

Select the appropriate keyboard layout. Install Ubuntu Server VMware keyboard

And also the layout type. Running a quick test on the characters helps with special ones when these are hidden for passwords. Install Ubuntu Server VMware keyboard layout

At this point the installer is copying the necessary packages from the ISO source file mounted on the virtual machine. Install Ubuntu Server VMware additional components

Next is to choose a Hostname. The NetBIOS Hostname cannot be longer than 15 characters including special ones. The “.” for obvious reasons cannot be used as part of the Hostname. Install Ubuntu Server VMware configure network

Next screens include the steps to create a non-admin user that can be used instead of root account. Initially this should be the real name of the user. Install Ubuntu Server VMware setup account name

Next the option to use the desired username for this account. Account and Username can also be the same. Install Ubuntu Server VMware setup username

And finally a password for this Account with the option to verify. Install Ubuntu Server VMware setup password

As a final touch for the Accounts’ creation the wizard also offers the ability to automatically encrypt the “home” folder which is the default writeable location for each account created on the local system. Install Ubuntu Server VMware home encryption

As a final question for this part the wizard prompts for the time zone details. Install Ubuntu Server VMware setup clock

In this part of the wizard now the options to configure the storage presented to this Ubuntu Server. Initially the idea is to create a simple machine with two disks. For now the “standard” partitioning will be used. Install Ubuntu Server VMware partition disks

The wizard detects the two iSCSI virtual disks connected to Ubuntu Server virtual machine. The Server will be installed on the first one identified as sda (0,0,0). Install Ubuntu Server VMware select disks

On this disk two partitions will be created by default: root and swap. Unless there are different requirements this partition layout should suffice as a standard Ubuntu Server machine. The new layout is now created on disk “sda” and the partitions properly formatted. Install Ubuntu Server VMware disk layout

At this point the wizard is ready to start copying the necessary packages from the ISO file to sda disk. Install Ubuntu Server VMware installing system

In case the network where the Ubuntu Server uses a Web Proxy the necessary details can be configured here or simply continue. Eventually these can be changed later on as well. Install Ubuntu Server VMware http proxy

As part of the built-in service in the Ubuntu Server also the option to choose how to streamline the updates. For now no automatic update is selected. Install Ubuntu Server VMware automatic updates

As part of the process to install Ubuntu Server the wizard allows to install also very popular and useful Server features like DNS, LAMP (Linux, Apache, MySQL and PHP), Mail, PostgreSQL and more. Install Ubuntu Server VMware software selection

Linux operating systems by default use GRUB as boot loader. It allows the correct boot order and many other options. And it can also coexist with other operating systems. Without installing this component, manual changes are required to the Master Boot Record (MBR). So best practice in this case is to install GRUB loader. Install Ubuntu Server VMware install GRUB loader

Since there are two partitions (sda and sdb) the best practice is to choose the first hard drive where the system is installed and making this disk bootable. Install Ubuntu Server VMware GRUB loader

At this point the install is completed. Next step is to unmount or simply disconnect the Ubuntu Server ISO file and continue to automatically reboot Server and make changes effective. Install Ubuntu Server VMware complete

A few seconds later the Ubuntu Server is ready with the terminal prompt. Install Ubuntu Server VMware console

ادامه مطلب