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 👍
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.
Happy Learning!!!!
4 Comments
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.
ReplyDeletethere is no need to do it on all app servers
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
DeleteHello! I was wondering why did you choose authnz_external over authnz_pam? thank you
ReplyDeleteGood question. Reason to used because in task it mentioned to have Basic Auth + PAM.
Delete