User Tools

Site Tools


helpful_ubuntu_commands

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
helpful_ubuntu_commands [2026/08/13 06:53] – mikehelpful_ubuntu_commands [2026/09/02 19:57] (current) – mike
Line 82: Line 82:
 ==== Ansible/Automation Related Info ==== ==== Ansible/Automation Related Info ====
      
-=== Generate password hashes (useful for Ansible playbooks amongst other things) ===+=== Generate password hashes (useful for Ansible playbooks, Ansible Vault, amongst other things) ===
   mkpasswd --method=sha-512   mkpasswd --method=sha-512
  
Line 134: Line 134:
   sudo netplan apply   sudo netplan apply
      
 +  Update the /etc/hosts file accordingly
 +
 +=== Changing the server's IP address from DHCP to static ===
 +
 +1. Disable cloud-init networking to avoid overwriting the new configuration:
 +  echo "network: {config: disabled}" | sudo tee /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
 +
 +2. cd into /etc/netplan and edit the file that is there.  Replace the contents with the following (supplying the specific IP address/etc where required):
 +
 +  network:
 +    version: 2
 +    renderer: networkd
 +    ethernets:
 +        ens18:
 +            dhcp4: false
 +            addresses:
 +              - 192.168.1.xx/24
 +            nameservers:
 +              addresses:
 +                - 192.168.1.1
 +            routes:
 +              - to: default
 +                via: 192.168.1.1
 +
 +3. Execute ''netplan apply'' to apply immediately or reboot to verify reboot survivability.
 + 
 === Changing the server's host name === === Changing the server's host name ===
   hostnamectl set-hostname [new host name]   hostnamectl set-hostname [new host name]
helpful_ubuntu_commands.1786629235.txt.gz · Last modified: by mike

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki