Ubuntu Change Hostname and IP after Clone

Mindwatering Incorporated

Author: Tripp W Black

Created: 10/18 at 05:03 PM

 

Category:
Linux
Configuration

Task:
Perform basic renaming tasks on Ubuntu VM clone.


Steps:
1. Using local console, login into New VM or use remote login if the original VM is still shut-down.
$ ssh myadminid@newserver@mindwatering.net


2. Update hostname:
a. Rename:
$ sudo hostnamectl set-hostname newserver

Verify:
$ sudo hostnamectl
<confirm output>

b. Update /etc/hosts
$ sudo vi /etc/hosts
<update any entries for oldserver to newserver, and save>


3. Update IP:
a. Locate netplan file:
$ cd /etc/netplan/
$ ls -l
<note the YAML file to edit>

b. Edit the netplan file:
$ sudo vi /etc/netplan/01-netcfg.yaml
<update the addresses line, and the gateway, etc, as needed>

c. Apply it:
$ sudo netplan apply
<confirm success>


4. Join new workstation to SAMBA domain:
a. Run the join command:
$ sudo net ads join -U administrator
<enter admin pwd>

b. Verify output says:
Joined 'NEWWORKSTATION' to dns domain 'mindwatering.net'


$


previous page

×