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 |
-
check if there is an IP assigned
if config -
nmtuito edit -
locate the device name
-
use the tab key to navigate
-
change IPV4 configuration to manual
-
show the configuration
-
enter address including / notation subnet
10.0.5.3/24 -
enter gateway (upstream)
10.0.5.2 -
enter DNS
10.0.5.2 -
enter domain controler
ina.local -
make sure there is an X next to automatically connect
-
select ok
-
set system hostname
dhcp01-ina -
quit
-
systemctl restart network
Helpfull commands from the lab
- to remotely access a Linux system
ssh ina@dhcp01-ina(usehostnameto 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
useradd inapasswd inausermod -aG wheel ina
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