Sitemap

Custom Apache User Setup

3 min readJun 3, 2024

--

Is time for another Kodkloud exercise/project 🤓😎

Scenario

In response to heightened security concerns, the xFusionCorp Industries security team has opted for custom Apache users for their web applications. Each user is tailored specifically for an application, enhancing security measures. Your task is to create a custom Apache user according to the outlined specifications:

a. Create a user named john on App server 3 within the Stratos Datacenter.

b. Assign a unique UID 1886 and designate the home directory as /var/www/john.

In previous article, I discussed what Linux is, but if this happen to be your first time reading my article, I got you. I will briefly explain what Linux is, its history and what it is use for.

Linux is a computer operating system much more like iOS and Windows. It can be used on laptops, large computer centers, and on cell phones. Linux was created in the early 1990s by Finnish- American software engineer Linus Benedict Torvalds.

All right let’s get started!

Press enter or click to view image in full size

First thing that I will do is to click on “Details of all Users and Servers” to find the credentials for server 3

Press enter or click to view image in full size

Now that I have the credentials, I can now login into the server by running this command

ssh your_username@host_ip_address

in this case it will be ssh banner@stapp03

Press enter or click to view image in full size

sudo su-

I will check if I have a user john by running this command

id john

And as you can see, no such user exist

Get Carlhector’s stories in your inbox

Join Medium for free to get updates from this writer.

I will now run this command to create the user name john

useradd -u 1886 john

Then I will run the following these twocommand to verify that user john was added

cat /etc/passwd |grep john

id -john

Now I will run this command to assign a unique UID 1886 and also designate the home directory as /var/www/john

usermod -d /var/www/john -m john

I will run cat /etc/passwd |grep john

Press enter or click to view image in full size

Ok now everything looks good, I will now check my work to see if I got it right

Press enter or click to view image in full size

Another successful exercise from Kodekloud. Thanks to all you guys that took the time to check out my article. See you guys on the next one.

--

--