SYS 265 tech journal - ryanm292002/Ryans-Repository GitHub Wiki

lab 00

This was a repeat and rebuild step for step from last semesters build, sys 255.

The only thing that really stumped me was I could ping to and from fw01 and ad01 by hostname and address but I could only ping from wks01 and mgmt01, I eventually figured out I had to make a firewall rule to allow incoming icmpv4 echo requests (ping), after that it all worked, I spent a ton of time thinking something was wrong with my reverse lookup zone in dns.

Heres where I found the solution of why I couldnt ping to my wks01 and mgmt01: https://community.spiceworks.com/topic/432705-unable-to-ping-client-pc

topic to better study: Powershell commands and its many filters

Get-DnsServerResourceRecord : https://docs.microsoft.com/en-us/powershell/module/dnsserver/get-dnsserverresourcerecord?view=windowsserver2022-ps you can also add records using add-DnsServerResourceRecord

display user : https://docs.microsoft.com/en-us/powershell/module/activedirectory/get-aduser?view=windowsserver2022-ps

How to find all zones, and find ptr records in powershell image

Lab - Network Management

  • Lab was all about configuring snmp, we configured snmp on the firewall through pfsense with the snmp daemon, then also installed it both on the nmon and web centos servers.

  • There was a lot of refreshers with setting up and configuring the centos devices, one thing is to rememeber is you join domains on linux devices through realMD, which I have the tutorial for in my SYS255 tech journal

  • Install snmp on Centos 7: sudo yum install net-snmp-utils (thats for clients only) add "net-snmp" when installing snmp server

  • How to use snmp (Centos commands): test nslookup then **snmpwalk -Os -c "community tag" -v2c "hostname of what device your trying to snmp query" **

-Config file and setting up SNMP server:

image

-Install snmp on windows device (specifically in this case a server core active directory) through the server manager , make sure to allow remote event log management or you wont be able to look at services on a remote devices: image

  • Configure SNMP security tab and simply add the community tag and allow packets from your SNMP server

Docker lab

Create new sudo user ubuntu: image

Adjust network on ubuntu server: image

upgrade/update packages: image

Install Docker image

Putting user in sudo Docker group image

Docker Documentation/tutorial: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-20-04

Install Docker Compose: image

Example of Docker Run command: image

Configuring WordPress on ubuntu with docker: 1. image 2. image

Git and linux script lab\

When doing git clone you just wanna do the link of your repository, the URL in the browser search tab

  1. git pull
  2. git add
  3. git commit -m 'message'
  4. git push git status is also helpful if you're lost

-create subdirectories into new directory: image

rsa keypair: image

new ssh user script (run script with name of user you want to create): https://github.com/ryanm292002/Ryans-Repository/blob/master/SYS265/linux/centos7/secure-ssh.sh

Ansible lab

For networking, use nmtui on linux devices or run: "sudo ip addr add 10.102.66.200/24 dev enp0s25"

sudo user on ubuntu: image

sudo su - 'name of user' ^allows you to switch to specified user

Install Ansible: sudo apt install ansible sshpass python3-paramiko

Ansible ping ad hoc: image

Ansible id ad hoc: image

Ansible-galaxy download (webmin used as example): image

Ansible playbook example (webmin used): image

run playbook: image

Install SSH from powershell:

  1. Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
  2. Start-Service sshd
  3. Set-Service -Name sshd -StartupType 'Automatic'

Set powershell as default shell when ssh into device: Set-ItemProperty "HKLM:\Software\Microsoft\Powershell\1\ShellIds" -Name ConsolePrompting -Value $true New-ItemProperty -Path HKLM:\SOFTWARE\OpenSSH -Name DefaultShell -Value "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -PropertyType String -Force

Deploy software on windows devices with win chocolatey (playbook example): image

AD GPO + SW LAB