Lab03 - InaFricke/SYS-255 GitHub Wiki

Switch network adapter to LAN was previously set to WAN

Process for setting a static IP address on CentOS Linux

Required  Fill in
IP Address and Netmask 10.0.5.3/24
Gateway 10.0.5.2
DNS 10.0.5.5
Search Domain ina.local
Hostname dhcp01-ina
  1. check if there is an IP assigned if config

  2. nmtui to edit

  3. locate the device name

  4. use the tab key to navigate

  5. change IPV4 configuration to manual

  6. show the configuration

  7. enter address including / notation subnet 10.0.5.3/24

  8. enter gateway (upstream) 10.0.5.2

  9. enter DNS 10.0.5.2

  10. enter domain controler ina.local

  11. make sure there is an X next to automatically connect

  12. select ok

  13. set system hostname dhcp01-ina

  14. quit

  15. systemctl restart network

image

Helpfull commands from the lab

  1. to remotely access a Linux system ssh ina@dhcp01-ina (use hostname to find name of system)

pwd cd /home ls cd .. ls -l man heir ~ mkdir yum install -y tree groups sudo i history ls -la

Show the present working directory  pwd
Navigate up to the /home directory and list the contents  cd /home
Navigate up to the parent directory using a relative cd .. command. It is relative to where you are in the directory structure.  cd .. ls
long listing of files and directories with ls -l.  ls -l
show the manual page indicating what each directory in the file hierarchy is used for.  man hier.  Read the description of the first level directories.  man hier
Use the "tilde" shortcut to go to the home directory ~  ~
Create and navigate to a directory called sys255 in your home directory  mkdir ____ cd ___ /
Elevate privileges using the sudo command.  This will only work if you set your named user to be an administrator.  The sudo command run this way will execute a single command as a privileged user then drop you back down to normal permissions.  sudo yum install -y tree
Show the groups your user has been assigned to.  In this case, the wheel group is analogous to the Administrator's group in Windows.  group
Become root for an extended time with sudo -i. Sudo -i
This is necessary if you have a lot to do in a privileged state, be sure to "exit" the root shell when you are done.  A second exit will probably close your SSH session. exit
The whoami command will show what user you are logged in as.  whoami

Add new user

Username: ina PW: HS

  1. useradd ina
  2. passwd ina
  3. usermod -aG wheel ina

image

File setup hierarchy

3 Linux commands

grep

Search for a string within an output. It can be used to better navigate logs. Almost like ctr f.

touch filename

allows you to create new empty files

cat

Option Function
cat > [fileName] To create a file.
cat [oldfile] > [newfile] To copy content from older to new file.
cat [file1 file2 and so on] > [new file name] To concatenate contents of multiple files into one.

Displays file contents on the terminal. Can create a file with content