Lab 03: Linux - Hsanokklis/2023-2024-Tech-journal GitHub Wiki
Linux Configuration
Networking DHCP
- Take a snapshot of your DHCP box
- Configure the network to your internal LAN segment
Power on your DHCP box
- Sign in with username root and the default Champlain pw
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:
- Check for DHCP IP address with "ifconfig"
- Type in "nmtui" to get to the interface to configure the host/ip
-
edit the connection
-
go to ens192
- change IPV4 config to Manual
- show the IPv4 config
- Configure IPv4
- Go to Set system hostname
- hostname set to dhcp01-hannelore
- restart the network with "systemctl restart network"
- do ifconfig command to check that your Ip address has been configured
Add a privileged user
-
exit and then resign in
-
useradd hannelore
-
passwd hannelore
- type in password (4Hannelore)
- Figure out how to add a named user who is a member of the wheel group (Linux’s local admin group on Centos)
Network Testing
Log in as your priviledged user
- Ping google, the firewall and the dns server
DNS
Figure out how to add A and PTR records in the ad01 for your dhcp
- Go to Server Manager --> DNS --> DNS Manager
- Successful Creation of dhcp01 forward zone
- PTR record (the ptr record is automatically created when the A record is created)
To test connectivity, ping the dhcp server from the workstation
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
getting around and sudo
Test these commands!*
- pwd (print working directory)
- cd /home (to get to the home directory)
- ls (to list the home directory contents)
- cd .. to navigate up the directories
- ls -l (creates long lists of files and directories)
- man heir (Linux Programmer's Manual)
- cd ~ (goes to the home directory)
-
mkdir (make directory)
-
cd sys255 (go to that directory)
- yum install -y tree (trying to install tree but don't have privileges)
- sudo install -y tree (installing tree with the sudo command gives you root access)
- show the groups the user has been assigned to
- sudo -i (become the sudo user for an extended amount of time
History
- provide the first 10 commands in your SSH command history
- do ls -la (or -a) for hidden files
- cat .bash_history (allows you to see your command history)
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