Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 18 additions & 17 deletions Cloud/0-linux/README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
# Linux Overview

----------------------
Costa Rica

Belinda Brown, belindabrownr04@gmail.com

[![GitHub](https://badgen.net/badge/icon/github?icon=github&label)](https://github.com) [![Open Source? Yes!](https://badgen.net/badge/Open%20Source%20%3F/Yes%21/blue?icon=github)](https://github.com/Naereen/badges/)

[![GitHub](https://img.shields.io/badge/--181717?logo=github&logoColor=ffffff)](https://github.com/) [brown9804](https://github.com/brown9804)


March, 2022
Last updated: 2025-07-10

----------------------

# Content

<!-- MarkdownTOC -->

- [Linux](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/2-linux)
- Lab 0 - [Working with Users and Permissions](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/2-linux/lab0)
- Lab 1 - [System Service Management, Runlevels and Boot Targets](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/2-linux/lab1)
- Lab 2 - [Securely Accessing Your System](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/2-linux/lab2)
- Lab 3- [Package Management and Troubleshooting](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/2-linux/lab3)
- Lab 4 - [File Management, Permissions and Backup](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/2-linux/lab4)
- Lab 5 - [Working with Text Files and Streams](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/2-linux/lab5)
- Lab 6 - [Linux Device Management](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/2-linux/lab6)
- Lab 7 - [The Linux Shell](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/2-linux/lab7)
- Lab 8 - [Networking](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/2-linux/lab8)
- Lab 9 - [Processes Management](https://github.com/brown9804/DevOps-Agile-Cloud_path/tree/main/Cloud/2-linux/lab9)
- Lab 0 - [Working with Users and Permissions](https://github.com/brown9804/Cloud-DevOps-Overview/tree/main/Cloud/0-linux/lab0)
- Lab 1 - [System Service Management, Runlevels and Boot Targets](https://github.com/brown9804/Cloud-DevOps-Overview/tree/main/Cloud/0-linux/lab1)
- Lab 2 - [Securely Accessing Your System](https://github.com/brown9804/Cloud-DevOps-Overview/tree/main/Cloud/0-linux/lab2)
- Lab 3- [Package Management and Troubleshooting](https://github.com/brown9804/Cloud-DevOps-Overview/tree/main/Cloud/0-linux/lab3)
- Lab 4 - [File Management, Permissions and Backup](https://github.com/brown9804/Cloud-DevOps-Overview/tree/main/Cloud/0-linux/lab4)
- Lab 5 - [Working with Text Files and Streams](https://github.com/brown9804/Cloud-DevOps-Overview/tree/main/Cloud/0-linux/lab5)
- Lab 6 - [Linux Device Management](https://github.com/brown9804/Cloud-DevOps-Overview/tree/main/Cloud/0-linux/lab6)
- Lab 7 - [The Linux Shell](https://github.com/brown9804/Cloud-DevOps-Overview/tree/main/Cloud/0-linux/lab7)
- Lab 8 - [Networking](https://github.com/brown9804/Cloud-DevOps-Overview/tree/main/Cloud/0-linux/lab8)
- Lab 9 - [Processes Management](https://github.com/brown9804/Cloud-DevOps-Overview/tree/main/Cloud/0-linux/lab9)

<!-- /MarkdownTOC -->

<!-- START BADGE -->
<div align="center">
<img src="https://img.shields.io/badge/Total%20views-195-limegreen" alt="Total views">
<p>Refresh Date: 2025-07-10</p>
</div>
<!-- END BADGE -->
42 changes: 23 additions & 19 deletions Cloud/0-linux/lab0/README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,42 @@
# Working with Users and Permissions

----------------------
Costa Rica

Belinda Brown, belindabrownr04@gmail.com

[![GitHub](https://badgen.net/badge/icon/github?icon=github&label)](https://github.com) [![Open Source? Yes!](https://badgen.net/badge/Open%20Source%20%3F/Yes%21/blue?icon=github)](https://github.com/Naereen/badges/)

[![GitHub](https://img.shields.io/badge/--181717?logo=github&logoColor=ffffff)](https://github.com/) [brown9804](https://github.com/brown9804)


March, 2022
Last updated: 2025-07-10

----------------------

This is a summary based on [References](#references)

### _Connect to the server_:
## _Connect to the server_:

`ssh <user_name>@<IPadress>`

### _Become root_:
## _Become root_:
`sudo -i` <br/>
Enter the cloud_user password at the prompt.

### _Add the Users to the Server_:
## _Add the Users to the Server_:
```
useradd tstark
useradd cdanvers
useradd dprince
```

### _Create the new group_:
## _Create the new group_:
`groupadd superhero` <br/>
Set wheel Group as the the tstark Account's Primary Group. The usermod command will change which group a user is in. Change tstark:
`usermod -g wheel tstark` <br/>
Make sure it worked: <br/>
`id tstark` <br/>
The command's output should show his primary group is now wheel.

### _Supplementary Group on All Three Users_:
## _Supplementary Group on All Three Users_:
Run the usermod command for each user:
```
usermod -aG superhero tstark
Expand All @@ -50,10 +47,10 @@ usermod -aG superhero cdanvers
Check with any of the users to make sure it worked: <br/>
`id <USERNAME>`

### _Lock a specific Account_:
## _Lock a specific Account_:
`usermod -L dprince`

### _Create New Users_:
## _Create New Users_:
Create a gfreeman user on the system: <br/>
`sudo useradd -m gfreeman`

Expand All @@ -66,7 +63,7 @@ sudo passwd gfreeman
sudo passwd avance
```

### _Verify the /etc/sudoers File and Test Access_:
## _Verify the /etc/sudoers File and Test Access_:

1. Verify that the /etc/sudoers file will allow the wheel group access to run all commands with sudo: <br/>
`sudo visudo` <br/>
Expand All @@ -81,7 +78,7 @@ sudo passwd avance
6. After you have verified avance can read the /etc/shadow file, log out of that account: <br/>
`exit`

### _Set Up the Web Administrator_:
## _Set Up the Web Administrator_:
1. Create a new sudoers file in the /etc/sudoers.d directory that will contain a standalone entry for webmasters: <br/>
`sudo visudo -f /etc/sudoers.d/web_admin`
2. Enter in the following at the top of the file: <br/>
Expand All @@ -97,7 +94,7 @@ sudo passwd avance
`sudo cat /etc/sudoers.d/web_admin` <br/>
Since the cat command is not listed in the command alias group for WEB, gfreeman cannot use sudo to read this file.

### _Enable SSH to Connect Without a Password from the dev User on server1 to the dev User on server2_:
## _Enable SSH to Connect Without a Password from the dev User on server1 to the dev User on server2_:
1. Generate an SSH key: <br/>
`[dev@server1]$ ssh-keygen`
2. Press Enter three times to accept the defaults.
Expand All @@ -108,7 +105,7 @@ Since the cat command is not listed in the command alias group for WEB, gfreeman
5. Log out to get back to server1: <br/>
`[dev@server2]$ logout`

### _Copy All tar Files from /home/dev/ on server1 to /home/dev/ on server2_:
## _Copy All tar Files from /home/dev/ on server1 to /home/dev/ on server2_:
1. Copy the files: <br/>
`[dev@server1]$ scp *.gz <server2_PRIVATE_IP>:~/`
2. Connect to server2 again: <br/>
Expand All @@ -117,7 +114,7 @@ Since the cat command is not listed in the command alias group for WEB, gfreeman
`[dev@server2]$ ll` <br/>
It should show the two files.

### _Extract the Files, Making Sure the Output is Redirected_:
## _Extract the Files, Making Sure the Output is Redirected_:
1. Extract the files: <br/>
```
[dev@server2]$ tar -xvf deploy_content.tar.gz >> tar-output.log
Expand All @@ -127,18 +124,25 @@ It should show the two files.
`ll` <br/>
We'll see the new files and their permissions.

### _Set the Umask So New Files Are Only Readable and Writeable by the Owner_:
## _Set the Umask So New Files Are Only Readable and Writeable by the Owner_:
1. We need to make new files with 0600 (`-rw-------`) permissions. Since the default is 0666, and we want it to be 0600, run the following: <br/>
`[dev@server2]$ umask 0066`

### _Verify the /home/dev/deploy.sh Script Is Executable and Run It_:
## _Verify the /home/dev/deploy.sh Script Is Executable and Run It_:
1. Check permissions on deploy.sh: <br/>
`[dev@server2]$ ls -l deploy.sh`
2. Make the script executable: <br/>
`[dev@server2]$ chmod +x deploy.sh`
3. Run it: <br/>
`[dev@server2]$ ./deploy.sh`

### References
## References

https://learn.acloud.guru/course/cad92c58-0fd2-4657-98f7-79268b4ff2db/dashboard

<!-- START BADGE -->
<div align="center">
<img src="https://img.shields.io/badge/Total%20views-195-limegreen" alt="Total views">
<p>Refresh Date: 2025-07-10</p>
</div>
<!-- END BADGE -->
38 changes: 21 additions & 17 deletions Cloud/0-linux/lab1/README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,34 @@
# System Service Management, Runlevels and Boot Targets

----------------------
Costa Rica

Belinda Brown, belindabrownr04@gmail.com

[![GitHub](https://badgen.net/badge/icon/github?icon=github&label)](https://github.com) [![Open Source? Yes!](https://badgen.net/badge/Open%20Source%20%3F/Yes%21/blue?icon=github)](https://github.com/Naereen/badges/)

[![GitHub](https://img.shields.io/badge/--181717?logo=github&logoColor=ffffff)](https://github.com/) [brown9804](https://github.com/brown9804)


March, 2022
Last updated: 2025-07-10

----------------------

This is a summary based on [References](#references)

### _Connect to the server_:
## _Connect to the server_:

`ssh <user_name>@<IPadress>`

## Configuring a Default Boot Target:
The LPIC-1 exam expects the candidate to know how to change a default target for a Linux computer using systemd. This exercise will assist you in your practice of determining what the default target is, and changing it to a new one.

### _Check the Default Target_:
## _Check the Default Target_:
The current default target is set to multi-user.target. Use the appropriate command to verify this: <br/>
`systemctl get-default`

### _Change the Default Target_:
## _Change the Default Target_:
The administrator will need to change the default target so that the computer boots into a graphical desktop: <br/>
`sudo systemctl set-default graphical.target`

### _Check the Default Target again_:
## _Check the Default Target again_:
Now verify that the system is set for a graphical boot: <br/>
`systemctl get-default`

Expand All @@ -41,24 +38,24 @@ We have been asked to run periodic backups of the website directory and, given t
Previously we wrote systemd unit files to back up the site and have been provided a file called web-backup.sh in our /root directory. Using that file and the associated web-backup.service, we will create a systemd timer unit file that will control the schedule of our service. <br/>
After we have all three components ready, we'll stage the files in their appropriate locations and start the service for our team and turn it back over for their use. <br/>

### _Sign in root_:
## _Sign in root_:
`[user@$host ~]$ sudo su -`
When prompted, enter the provided lab credentials to finish logging in.

Considerations:
Part of this job is already done. In a previous lab (lab0), we wrote the systemd unit file, web-backup.service in the /root directory, which we will use alongside the web-backup.sh file that the Dev team gave us. To use it, we need to make sure we are in /root and that the file is there.

### _Checking path_:
## _Checking path_:
`[root@$host ~]# pwd` <br/>

### _Checking content_:
## _Checking content_:
`[root@$host ~]# ls`
Output: <br/>
```
web-backup.sh web-backup.service
```

### _Create a Timer Unit File_:
## _Create a Timer Unit File_:
1. With our items sourced, we are ready to create the timer unit file. To do so, use the vi command along with web-backup.timer:
`[root@$host ~]# vi web-backup.timer` <br/>
2. Fill out the information as follows:
Expand All @@ -78,13 +75,13 @@ WantedBy=multi-user.target
Note that 23:00:00 can be set to anything. We're just picking 11:00 PM here as an example. <br/>
When the file is correct, remember to write and quit properly from vi using the Esc key, : (the colon), then w, then q.

### _Putting Files Where They Belong_:
## _Putting Files Where They Belong_:
1. With everything ready, we now need to make sure our files are in the correct locations. The shell script needs to be copied into /usr/local/sbin with the cp command: <br/>
`[root@$host ~]# cp web-backup.sh /usr/local/sbin/`
2. Then, using the cp command again, copy both the service and timer files into /etc/systemd/: <br/>
`[root@$host ~]# cp web-backup.{service,timer} /etc/systemd/system/`

### _Tell systemd to Run The Files_:
## _Tell systemd to Run The Files_:
1. With our files in place, we need to reload the systemd daemon so that it can calculate the service dependencies: <br/>
`[root@$host ~]# systemctl daemon-reload`
2. Now enable the services to run at boot: <br/>
Expand All @@ -108,7 +105,7 @@ They both show as running, meaning this server is ready to go back to the Dev te
## Working with System Service Log Files Using the Journal Control:
This is to understand how to use the built-in journalctl utility to view and troubleshoot system services.

### _Check the Web Server Configuration File_:
## _Check the Web Server Configuration File_:
1. Change to the root account: <br/>
`sudo su -`
2. Check the status of the web service: <br/>
Expand All @@ -124,12 +121,19 @@ This is to understand how to use the built-in journalctl utility to view and tro
7. Restart the service: <br/>
`systemctl restart httpd.service`

### _Verify That the Web Server Service Is Running_:
## _Verify That the Web Server Service Is Running_:
1. Check the status of the service: <br/>
`systemctl status httpd.service`
2. Navigate to the local web page: <br/>
`elinks http://localhost`

### References
## References

https://learn.acloud.guru/course/cad92c58-0fd2-4657-98f7-79268b4ff2db/dashboard

<!-- START BADGE -->
<div align="center">
<img src="https://img.shields.io/badge/Total%20views-195-limegreen" alt="Total views">
<p>Refresh Date: 2025-07-10</p>
</div>
<!-- END BADGE -->
Loading
Loading