New to Linux? Below assignment covering all the required basics of Linux to be familiar for an DevOps engineer.

Linux Project

Skills

Below skills are required to complete the deployment steps:

Linux User Management, Permissions, Directory Structure, File Systems, File Management

Pre-Requisites

Login to AWS cloud and create Linux based EC2 instance to complete the below assignment.

Deployment

  1. Login to the server as super user and perform below
    1. Create users and set passwords – user1, user2, user3
    2. Create Groups – devops, aws
    3. Change primary group of user2, user3 to ‘devops’ group
    4. Add ‘aws’ group as secondary group to the ‘user1’
    5. Create the file and directory structure shown in the above diagram.
    6. Change group of /dir1, /dir7/dir10, /f2 to “devops” group
    7. Change ownership of /dir1, /dir7/dir10, /f2 to “user1” user.
  2. Login as user1 and perform below
    1. Create users and set passwords – user4, user5
    2. Create Groups – app, database
  3. Login as ‘user4’ and perform below
    1. Create directory – /dir6/dir4
    2. Create file – /f3
    3. Move the file from “/dir1/f1” to “/dir2/dir1/dir2”
    4. Rename the file ‘/f2′ to /f4’
  4. Login as ‘user1’ and perform below
    1. Create directory – “/home/user2/dir1”
    2. Change to “/dir2/dir1/dir2/dir10” directory and create file “/opt/dir14/dir10/f1” using relative path method.
    3. Move the file from “/opt/dir14/dir10/f1” to  user1 home directory
    4. Delete the directory recursively “/dir4”
    5. Delete all child files and directories under “/opt/dir14” using single command.
    6. Write this text “Linux assessment for an DevOps Engineer!! Learn with Fun!!” to the /f3 file and save it.
  5. Login as ‘user2’ and perform below
    1. Create file “/dir1/f2”
    2. Delete /dir6
    3. Delete /dir8
    4. Replace the “DevOps” text to “devops” in the /f3 file without using  editor.
    5. Using Vi-Editor copy the line1 and paste 10 times in the file /f3.
    6. Search for the pattern “Engineer” and replace with “engineer” in the file /f3 using single command.
    7. Delete /f3
  6. Login as ‘root’ user and perform below
    1. Search for the file name ‘f3’ in the server and list all absolute  paths where f3 file is found.
    2. Show the count of the number of files in the directory ‘/’
    3. Print last line of the file ‘/etc/passwd’
  7. Login to AWS and create 5GB EBS volume in the same AZ of the EC2 instance and attach EBS volume to the Instance.
  8. Login as ‘root’user and perform below
    1. Create File System on the new EBS volume attached in the previous step
    2. Mount the File System on /data directory
    3. Verify File System utilization using ‘df -h’ command – This command must show /data file system
    4. Create file ‘f1’ in the /data file system.
  9. Login as ‘user5’ and perform below
    1. Delete /dir1
    2. Delete /dir2
    3. Delete /dir3
    4. Delete /dir5
    5. Delete /dir7
    6. Delete /f1 & /f4
    7. Delete /opt/dir14
  10. Logins as ‘root’ user and perform below
    1. Delete users – ‘user1, user2, user3, user4, user5’
    2. Delete groups – app, aws, database, devops
    3. Delete home directories  of all users ‘user1, user2, user3, user4, user5’ if any exists still.
    4. Unmount /data file system
    5. Delete /data directory
  11. Login to AWS and detach EBS volume to the EC2 Instance and delete the volume and then terminate EC2 instance.

All done? still not confident? repeat the steps!

Happy Learning!

© Edwiki Trainings – Click HERE If you are interested to learn more on Cloud & DevOps stack.

 

14 Shares:
15 comments
  1. Firstly, thank you PR for creating such good exercises which challenge us and make us grow.

    The exercise was thorough which covered almost all the Linux stuff used in realtime. The best thing in learning this way is getting our hands dirty. I’ve come across some blockers and was able to troubleshoot/understand my mistakes and learn from it. The learning process is wholesome, please come up with more such fun challenging exercises.

  2. can anyone explain what does this means “Change to “/dir2/dir1/dir2/dir10” directory and create file “/opt/dir14/dir10/f1” using relative path method.”

    1. Keep “/dir2/dir1/dir2/dir10” as your present working directory and then create file “/opt/dir14/dir10/f1” using relative path method.

  3. can anyone confirm the solution for “Replace the “DevOps” text to “DevOps” in the /f3 file without using editor.” is

    cat f3
    Copy content to clipboard
    cat >f3
    Paste from clipboard (or type new text)
    Finish with [CTRL]-[d]

  4. Yes, below command works.
    SED -I ‘S/DEVOPS/DEVOPS/G’ /f3
    NOTE: Sudo not required in all the commands, sudo is as needed if the command should run from sudo permissions only.

  5. caN anyone let me know how to do below mentioned step?

    Replace the “DevOps” text to “devops” in the /f3 file without using editor
    Search for the pattern “Engineer” and replace with “engineer” in the file /f3 using single command.

  6. I was able to complete all the tasks. But, it took some time for me as most of the tasks were not covered. But it was a good learning experience.

  7. This was a grilling and i appreciate the exercise.
    It really drives you to research and find things out for yourself.
    i will repeat it again.
    for this question: can anyone confirm the solution for “Replace the “DevOps” text to “DevOps” in the /f3 file without using editor.” is

    i simply used cat >> command and retyped the sentence because it was a short sentence.
    i hope i am correct

Leave a Reply

Your email address will not be published. Required fields are marked *

You May Also Like