Setting up a cloned CentOS 8 server
Once the cloning of your Cloud server with CentOS as operating system is done, you can use the newly deployed machine to test your website or have a pre-production environment. To start operating with your clone you will need to provision your server with a series of prior modifications.
Preparing the environment
Access the dashboard of the cloned machine and click on the icon corresponding to the SSH console.
Login to the cloned machine with the root user and the password of the original machine (note the special characters in the ASCII code).
Once you have logged into the cloned server you will need to modify the /etc/sysconfig/network-scripts/ifcfg-eth0
file, for example with the nano editor and modify the existing public IP in the file to the new public IP of the cloned machine, which you will have received by mail.
nano ifcfg-eth0
ifcfg-eth0 file with the initial configuration
E-mail with the access credentials
Updated ifcfg-eth0 file
Once edited you must start the network service by executing the following commands:
nmcli networking off
nmcli networking on
You can check the modification of the newly configured IP by executing the command:
ifconfig -a
Modifying the hosts and hostname files
Connect via SSH to the new server and modify the /etc/hosts
and /etc/hostname
files changing the original hostname to the hostname you received by email.
nano /etc/hosts
Hosts file with the initial configuration
Hosts file with the final configuration
nano /etc/hostname
Hostsname file with the initial configuration
Hostname file with the final configuration
Modify root user password
To change the root passwd, run the following command, indicating the password you received by e-mail.
Where it says # passwd root
, enter the password that appears in your email.
In this way, the new cloned machine will have the same IP, with its corresponding root name and password finishing the cloning process and starting up the cloned server.
danger IMPORTANT: to save the changes with the nano editor remember to you will have to press the keys control + x
of the keyboard.