PAM Authentication For Apache KodeKloud Engineer Task Success

Ticker

6/recent/ticker-posts

PAM Authentication For Apache KodeKloud Engineer Task Success



Question:   a. We want to use basic authentication.

 b. We do not want to use htpasswd file base authentication. Instead, we want to use PAM authentication, i.e Basic Auth + PAM so that we can authenticate with a Linux user.

 c. We already have a user rose with password B4zNgHA7Ya which you need to provide access to.


Please Note :-  Perform the below commands based on your question server,  user name & other details that might differ. So please read the task carefully before executing it. All the Best 👍



Solution:  

1. At first login on app server  ssh tony@stapp01

 2. Switch to  root user : sudo su -

 3. Run Below command to install  PWAUTH

     yum --enablerepo=epel -y install mod_authnz_external pwauth 


4. Edit the  vi /etc/httpd/conf.d/authnz_external.conf  file and Added below lines end of config file & Save it ( Refer to the Video for more clarity )

<Directory /var/www/html/protected>

AuthType Basic

AuthName "PAM Authentication"

AuthBasicProvider external

AuthExternal pwauth

require valid-user

</Directory>


5. Run the Below command to create a protected directory & cat the index.html file

mkdir -p /var/www/html/protected

cat /var/www/html/protected/index.html


6. Post saved config file , start the httpd services

systemctl start httpd

7.  Validate Apache HTTPd running  as per the task request


Please Note :- I have shown only for stapp01

You have to do this in all app server stapp01,stapp02, stapp03. 


8.  Click on Finish & Confirm to complete the task successfully

Happy Learning!!!!


Apart from this if you need more clarity,  I have made a  tutorial video on this , please go through and share your comments. Like and share the knowledge



Post a Comment

4 Comments

  1. Hello team, I had the question stating that i should do that on app server 3 only, and i did so, and got the task completed.
    there is no need to do it on all app servers

    ReplyDelete
    Replies
    1. Thanks for the Update. Glad to know you completed the task. Please note Server's can be any one or all depends on the lab you got. So request everyone to read task carefully before start. Keep Learning . All the best

      Delete
  2. Hello! I was wondering why did you choose authnz_external over authnz_pam? thank you

    ReplyDelete
    Replies
    1. Good question. Reason to used because in task it mentioned to have Basic Auth + PAM.

      Delete

Latest Posts

KodeKloud Kubernetes Security CKS  Lab Challenge 4 |  Audit-policy | Install & configure falco utility | Inspect the API server audit logs and identify the user