From a3f2a7bdd1f78808de10df2df19a7513702df5c4 Mon Sep 17 00:00:00 2001 From: Emmanuel Maximo Date: Sun, 15 Feb 2026 15:10:06 +0800 Subject: [PATCH 1/2] Added detailed solution for Linux Level 3 --- .../linux/level-3/apache-redirects/README.md | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/curriculum/linux/level-3/apache-redirects/README.md b/curriculum/linux/level-3/apache-redirects/README.md index ce9a4f2..321725b 100644 --- a/curriculum/linux/level-3/apache-redirects/README.md +++ b/curriculum/linux/level-3/apache-redirects/README.md @@ -20,16 +20,20 @@ b.) Redirect http://www.stapp01.stratos.xfusioncorp.com:/blog/ to http://w sshpass -p Ir0nM@n ssh -o StrictHostKeyChecking=no tony@172.16.238.10 -cd /etc/httpd/conf.d +cd /etc/httpd/conf -sudo vi httpd.conf cat /etc/httpd/conf/httpd.conf | grep Listen +sudo vi httpd.conf change Listen to 8083 +# Add ServerName to main config +echo "ServerName stapp01.stratos.xfusioncorp.com" | sudo tee -a /etc/httpd/conf/httpd.conf + +cd /etc/httpd/conf.d vi xfusion.conf " -NameVirtualHost *:8083 + *:8083 ServerName stapp01.stratos.xfusioncorp.com @@ -42,14 +46,30 @@ NameVirtualHost *:8083 " -echo "Ir0nM@n" | sudo -S systemctl restart httpd +sudo systemctl restart httpd +sudo mkdir -p /var/www/html/news + +# If you have content in /blog/, you might want to copy it: +sudo cp -r /var/www/html/blog/* /var/www/html/news/ 2>/dev/null || echo "index" | sudo tee /var/www/html/news/index.html + +# Set proper permissions +sudo chown -R apache:apache /var/www/html/news +sudo chmod -R 755 /var/www/html/news + +# Test configuration +sudo httpd -t + +# Restart Apache +sudo systemctl restart httpd # How to check curl -vL http://stapp01.stratos.xfusioncorp.com:8083 curl -vL http://stapp01.stratos.xfusioncorp.com:8083/blog +curl -vL http://stapp01.stratos.xfusioncorp.com:8083/news + ``` - See: [Ansible solution](solution.yaml) From ce6bd3f23c6117506ef1fc97d78973ac8f1831cd Mon Sep 17 00:00:00 2001 From: maximolds Date: Mon, 16 Feb 2026 10:07:06 +0800 Subject: [PATCH 2/2] Added 3 new solutions for Linux Level3 --- .../Install and Configure SFTP/Solution.md | 48 +++++++++++++++++ .../Install and Configure Tomcat/Solution.md | 41 ++++++++++++++ .../Linux Network Services/Solution.md | 53 +++++++++++++++++++ 3 files changed, 142 insertions(+) create mode 100644 curriculum/linux/level-3/Install and Configure SFTP/Solution.md create mode 100644 curriculum/linux/level-3/Install and Configure Tomcat/Solution.md create mode 100644 curriculum/linux/level-3/Linux Network Services/Solution.md diff --git a/curriculum/linux/level-3/Install and Configure SFTP/Solution.md b/curriculum/linux/level-3/Install and Configure SFTP/Solution.md new file mode 100644 index 0000000..5055f61 --- /dev/null +++ b/curriculum/linux/level-3/Install and Configure SFTP/Solution.md @@ -0,0 +1,48 @@ +### Solution + +```shell + +sshpass -p Ir0nM@n ssh -o StrictHostKeyChecking=no tony@172.16.238.10 + + +# 1. Create user 'ammar' in 'ftp' group +sudo useradd -m -g ftp -s /bin/bash ammar + +# 2. Set password to 'LQfKeWWxWD' +echo "ammar:LQfKeWWxWD" | sudo chpasswd + +# 3. Verify creation +id ammar + + +# 4. Create user with nologin shell (blocks SSH) +sudo useradd -m -g ftp -s /sbin/nologin ammar + +# 5. Setup chroot directory structure +sudo chown root:root /home/ammar +sudo chmod 755 /home/ammar +sudo mkdir -p /home/ammar/upload +sudo chown ammar:ftp /home/ammar/upload +sudo chmod 755 /home/ammar/upload + +# 6. Add to /etc/ssh/sshd_config (at the end) +sudo tee -a /etc/ssh/sshd_config > /dev/null << 'EOF' + +Match Group ftp + ChrootDirectory /home/%u + ForceCommand internal-sftp + AllowTcpForwarding no + X11Forwarding no +EOF + +# 7. Test and restart SSH +sudo sshd -t +sudo systemctl restart sshd + +# ✅ SFTP should work +sftp ammar@localhost + +# ❌ SSH should fail with "sftp connections only" +ssh ammar@localhost + +``` \ No newline at end of file diff --git a/curriculum/linux/level-3/Install and Configure Tomcat/Solution.md b/curriculum/linux/level-3/Install and Configure Tomcat/Solution.md new file mode 100644 index 0000000..ac300a0 --- /dev/null +++ b/curriculum/linux/level-3/Install and Configure Tomcat/Solution.md @@ -0,0 +1,41 @@ + +### Problem + +The Nautilus application development team recently finished the beta version of one of their Java-based applications, which they are planning to deploy on one of the app servers in Stratos DC. After an internal team meeting, they have decided to use the tomcat application server. Based on the requirements mentioned below complete the task: + +a. Install tomcat server on App Server 1. + +b. Configure it to run on port 6400. + +c. There is a ROOT.war file on Jump host at location /tmp. + + +Deploy it on this tomcat server and make sure the webpage works directly on base URL i.e curl http://stapp01:6400 + + +### Solution + +```shell + +sudo yum update + +sudo yum install tomcat + +# Configure port 6400 +sudo sed -i 's/port="8080"/port="6400"/' /etc/tomcat/server.xml + +# Copy to /tmp first +scp /tmp/ROOT.war tony@stapp01.stratos.xfusioncorp.com:/tmp/ + +# Deploy ROOT.war (copy from Jump Host first) +sudo rm -rf /var/lib/tomcat/webapps/ROOT* +sudo cp /tmp/ROOT.war /var/lib/tomcat/webapps/ +sudo chown tomcat:tomcat /var/lib/tomcat/webapps/ROOT.war + +# Start Tomcat +sudo systemctl enable --now tomcat + +# Test +curl http://stapp01:6400 + +``` \ No newline at end of file diff --git a/curriculum/linux/level-3/Linux Network Services/Solution.md b/curriculum/linux/level-3/Linux Network Services/Solution.md new file mode 100644 index 0000000..4258206 --- /dev/null +++ b/curriculum/linux/level-3/Linux Network Services/Solution.md @@ -0,0 +1,53 @@ +### Problem + +Our monitoring tool has reported an issue in Stratos Datacenter. One of our app servers has an issue, as its Apache service is not reachable on port 8084 (which is the Apache port). The service itself could be down, the firewall could be at fault, or something else could be causing the issue. + + +Use tools like telnet, netstat, etc. to find and fix the issue. Also make sure Apache is reachable from the jump host without compromising any security settings. + +Once fixed, you can test the same using command curl http://stapp01:8084 command from jump host. + +Note: Please do not try to alter the existing index.html code, as it will lead to task failure. + + +### Solution + +```shell + +#### Jumphost + +iptables -L -n + +#### stapp01 + +ssh tony@stapp01 + +curl http://localhost:8084 + +systemctl status httpd + +grep -iR "^Listen" /etc/httpd/ + +vi /etc/httpd/conf/httpd.conf + +netstat -tlnp | grep -i 8084 + +systemctl stop email +systemctl disbale email + +systemctl start httpd +systemctl enable httpd + +curl http://localhost:8084 + +iptables -L -n + +iptables -I INPUT 5 -p tcp --dport 8084 -j ACCEPT +service iptables save + +exit + +#### Jumphost + +curl http://localhost:8084 + ``` \ No newline at end of file