Lab 03: Linux - Hsanokklis/2023-2024-Tech-journal GitHub Wiki

Linux Configuration

image

Networking DHCP

  • Take a snapshot of your DHCP box

image

  • Configure the network to your internal LAN segment

image

Power on your DHCP box

  • Sign in with username root and the default Champlain pw

image

Set the hostname and IP address on your DHCP box

I followed these instructions to do so: https://sites.google.com/a/champlain.edu/cncs-wiki/home/operating-systems/linux/network-configuration

DHCP network settings:

image

  • Check for DHCP IP address with "ifconfig"

image

  • Type in "nmtui" to get to the interface to configure the host/ip

image

  • edit the connection

  • go to ens192

image

  • change IPV4 config to Manual

image

  • show the IPv4 config

image

  • Configure IPv4

image

  • Go to Set system hostname

image

  • hostname set to dhcp01-hannelore

image

image

  • restart the network with "systemctl restart network"

image

  • do ifconfig command to check that your Ip address has been configured

image

Add a privileged user

  • exit and then resign in

  • useradd hannelore

  • passwd hannelore

image

  • type in password (4Hannelore)

image

  • Figure out how to add a named user who is a member of the wheel group (Linux’s local admin group on Centos)

image

Network Testing

Log in as your priviledged user

image

  • Ping google, the firewall and the dns server

image

DNS

Figure out how to add A and PTR records in the ad01 for your dhcp

  • Go to Server Manager --> DNS --> DNS Manager

image

image

  • Successful Creation of dhcp01 forward zone

image

  • PTR record (the ptr record is automatically created when the A record is created)

image

To test connectivity, ping the dhcp server from the workstation

image

Remote Access from ad01

Systems Administrators will typically manage linux systems remotely via SSH (Secure Shell). An application called PuTTY was popular for this purpose and can still be optionally installed. Fortunately, Windows 10 now ships with an SSH client and we’ll use this.

  • Successfully SSH to dhcp01

image

getting around and sudo

Test these commands!*

  • pwd (print working directory)

image

  • cd /home (to get to the home directory)
  • ls (to list the home directory contents)

image

  • cd .. to navigate up the directories

image

  • ls -l (creates long lists of files and directories)

image

  • man heir (Linux Programmer's Manual)

image

  • cd ~ (goes to the home directory)

image

  • mkdir (make directory)

  • cd sys255 (go to that directory)

image

  • yum install -y tree (trying to install tree but don't have privileges)

image

  • sudo install -y tree (installing tree with the sudo command gives you root access)

image

image

  • show the groups the user has been assigned to

image

  • sudo -i (become the sudo user for an extended amount of time

image

History

  • provide the first 10 commands in your SSH command history

image

  • do ls -la (or -a) for hidden files

image

  • cat .bash_history (allows you to see your command history)

image

What security implementations does the .bash_history file represent?

When you view the .bash_history file, you are able to view that commands that have been executed for x amount of sessions. If a user from a previous session does not clear their .bash_history file an adversary might be able to view said commands and implement malicious code around what has been executed.

  • Pro: allows you to view commands you might have used in previous sessions
  • Con: Adversaries can delete their commands by manually clearing the bash_history

what command is used to clear bash history?

  • rm ~/.bash_history