NICE: Linux Administration 201


Networking Configurations

IP Address

To set the IP address, the /etc/network/interfaces can be set.

First, create a backup of the current config file with

  • sudo cp /etc/network/interfaces /etc/network/interfaces.bak

Now apply the proper configurations to the eth0 interface.

  • address 172.16.30.6
  • network 172.16.30.0
  • netmask 255.255.255.0
  • gateway 172.16.30.2
DNS
  • The /etc/resolv.conf file is used to assign nameservers.
  • The file has the immutable flag set, making it uneditable.
  • To remove the immutable flag use the chattr command
    • chattr -i /etc/resolv.conf
  • The contents of the file reveal a typo
  • Fix the typo by deleting the extra 5 in the IP address
    • The IP address of the DNS server is 172.16.30.5

Hostname and Active Directory DNS

Hostname

The hostname of the Kali machine can be changed with the hostname command

  • sudo hostname SecConsultantKali
AD DNS

To create a DNS entry on the Domain Controller for the Kali machine, open the Server Tools

Under the Tools drop down menu, select DNS

Under Forward Look Up Zones, Select the daswebs.com zone.

With the daswebs.com zone selected, click the menu item for “Create New Entry”

Select “New Host (A / AAAA)

Configure the fields accordingly

  • IP address of the kali machine - 172.16.30.6
  • Hostname of the kali machine - SecConsultantKali
  • Check the box to create an additional PTR record.

Account Creation and Setup

Ms. Randolph’s account can be created with the adduser command.

  • The –shell option can be used to set the usershell as requested by Ms. Randolph.
  • The adduser will be default create a homefolder within the /home directory. sudo adduser –shell /bin/bash drandolph

To grant the drandolph user sudo permissions, the /etc/sudoers file can be edited.

  • The sudoedit command can be used to edit the /etc/sudoers file, and will warn of syntax errors.
  • sudoedit /etc/sudoers
  • Append the following line to grant sudo access to the account for all commands.
    • drandolph ALL=(ALL:ALL)

Notes

  • The ifdown and ifup commands can be used to bring the network interface offline/online respectively.
  • The systemctl restart networking command can be used to restart the network service.
  • These commands can be helpful to ensure that configuration changes have been applied.