llog - learning linux log

Static website built with mkdocs.org .

  • Re-create creating a new ubuntu server 18.04 lts virtual machine on VMWare
  • Provisioning a new debian based distro
  • create an admin user called tux
  • use vmware12 for passwords on tux and root
  • create ~/bin and add path to .bashrc
  • activate .bash_aliases by creating a few entries.
alias lports='netstat -taupen'
alias od='od -A x -t x1z -v'
alias lr='ls -latr'
  • create .funcs add the following new functions
whdr() {
  echo '<!DOCTYPE html><head><title>bash2web</title></head><body><pre>' 
}
wftr() {
  echo '</pre></body></html>' 
}
today() {
  date +%Y%m%d 
}

sftp

Goal: how to move data from the jeremy server to your freeshell account.

HEREDOC

  • generate the upit script
  • login as root (id 0)
  • apt update; apt upgrade
  • apt install vim
  • mkdir /root/bin
  • echo export PATH="$PATH:$HOME/bin"' >> ~/.bashrc
cat > upit <<UPITALL
#!/bin/bash
# /root/bin/upit 

apt-get check
apt-get update
apt-get -y upgrade
apt-get -y dist-upgrade
apt clean
apt -y autoclean
apt remove
apt -y autoremove --purge
cat /etc/os-release
cat /proc/version
lsb_release
sync

# to fix repos
#dpkg --configure -a
#apt-get -f install
#--
UPITALL

LVM lab review

Watch the video on canvas as a few steps are occluded here

fdisk /dev/sdb
fdisk /dev/sdc
fdisk /dev/sdd
pvcreate /dev/sdb1 /dev/sdc1 /dev/sdd1
pvs
pvdisplay
vgcreate deb10lvm /dev/sdb1 /dev/sdc1 /dev/sdd1
vgs
vgdisplay
vgscan
lvcreate --name lvone --size 1G deb10lvm
lvcreate --name lvtow --size 1G deb10lvm
lvcreate --name lvthree --size 1G deb10lvm
lvcreate --name lvfour --size 1G deb10lvm
lvs
lvdisplay
mkfs.ext4 /dev/deb10lvm/lvone
mkfs.ext4 /dev/deb10lvm/lvtow
mkfs.ext4 /dev/deb10lvm/lvthree
mkfs.ext4 /dev/deb10lvm/lvfour
cd mnt
mkdir lv1 lv2 lv3 lv4
mount /dev/deb10lvm/lvone /mnt/lv1
mount /dev/deb10lvm/lvtow /mnt/lv2
mount /dev/deb10lvm/lvthree /mnt/lv3
mount /dev/deb10lvm/lvfour /mnt/lv4
vi /etc/fstab

small distro

Goal: find a nice small distro you can use for repair
add linux to any of the below in your search engine.
- absolute
- alpine rancheros silverblue (used as Docker Servers)
- tinycore
- antix lubuntu lxle boidhi bunsenlabs sparky
- slitaz
- porteus
- ttylinux (stale)
- puppy debiandog - peppermint
- linux lite

grub

Goal: modify grub to boot an .iso as an option to your deb10vm
modify the .vmx to boot any distro from the virtual cdrom
/path/to/your/vm/ vi vmname.vmx add the following as line 3

      bios.bootdelay = "20000"  

This allows the boot selection menu to show allows for boot from cdrom.

If you do it this way make sure you get the Live version of Kali

wget https://cdimage.kali.org/kali-2020.1b/kali-linux-2020.1b-live-amd64.iso  

add to /etc/grub.d/40_custom

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above. /etc/grub.d/40_custom

menuentry 'kali-linux-amd64.iso' {
set isofile='/mnt/iso/kali-linux-2020.1-live-amd64.iso'
loopback loop $isofile
linux (loop)/live/vmlinuz boot=live findiso=$isofile noconfig=sudo username=root hostname=kali
initrd (loop)/live/initrd.img
}

Add users script

Goal: how to automate installing 10 users (user01 - user10)

Final Project

Goal: Do all again - except using Ubuntu Server 18.04.4 LTS
- add a LAMP stack and change the default webpage

Final exam - Yes, but ..

Goal: Test Prep for Linux+
- It does not matter what you score. Just complete one of the practice tests.
You may encounter problems - try again during off peak hours
Goto to myacm.accm.org - O'Reilly Tab
Search for CompTIA Linux+ XK0-004
- This is the new test. Here is the link
acm.org - Linux+ Practice Test

AWS Lab

Goal: Exposure to a skill to pay a bill.
- Feel free to do the Final Project on AWS
AWS Lab

You have a $50.00 credit for Amazon web services.