Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

Exam 202-450 topic 1 question 31 discussion

Actual exam question from LPI's 202-450
Question #: 31
Topic #: 1
[All 202-450 Questions]

In order to protect a directory on an Apache HTTPD web server with a password, this configuration was added to an .htaccess file in the respective directory:

Furthermore, a file /var/www/dir/ .htpasswd was created with the following content: usera:S3cr3t
Given that all these files were correctly processed by the web server processes, which of the following statements is true about requests to the directory?

  • A. The user usera can access the site using the password s3cr3t
  • B. Accessing the directory as usera raises HTTP error code 442 (User Not Existent)
  • C. Requests are answered with HTTP error code 500 (Internal Server Error)
  • D. The browser prompts the visitor for a username and password but logins for usera do not seem to work
  • E. The web server delivers the content of the directory without requesting authentication
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
juerware
Highly Voted 2 years, 5 months ago
The correct anwser is D, it gets constanly asking for login and password. I have proven it in debian 11 with apache2 service with following configuration: # htpasswd -c /var/www/html/.auth usera hellowworld <Directory "/var/www/html/"> AuthName "Private section aramirez" AuthType Basic # AuthBasicProvider file # this is the default value AuthUserFile "/var/www/html/.auth" Require valid-user </Directory> if password is encrypted in .auth file it works right, if not then it gets repeating asking for login/passsword
upvoted 11 times
...
lite2000
Highly Voted 3 years, 8 months ago
It is A, the answer is correct because that user was created just for that purpose, I am just seeing Linux Academy videos and when you create a user in the .htaccess file it works when you login with those credentials.
upvoted 7 times
roach7
3 years, 1 month ago
No that is not correct. Apache expects an encrypted password in .htpasswd. In this case it is not true. The password was written in plaintext in the .htpasswd file. It should have been created using htpasswd -c /var/www/dir.htpasswd usera (after the prompt type in the password)
upvoted 8 times
...
...
MaikyCR28
Most Recent 7 months, 3 weeks ago
A. "The user usera can access the site using the password s3cr3t", the password on the htpasswd file is "S3cr3t" with capital "S". B. No, the user does exists in the htpasswd file. C. Error code 500 means there's a web server error, according to the provided configuration. There shouldn't be a problem preventing the website from loading D. How do we know the login for usera didn't work if the entered password is not mentioned? E. In normal aspects, the web content should be delivered to the user. I don't think the E answer is the 100% correct, but I think is more logic than the previous ones.
upvoted 1 times
...
marcelo_saad
8 months, 2 weeks ago
Selected Answer: D
answer is D
upvoted 2 times
...
marcelo_saad
8 months, 2 weeks ago
Selected Answer: D
D is correct!
upvoted 2 times
...
m2t4eus
10 months, 1 week ago
Selected Answer: A
" Given that all these files were correctly processed by the web server processes"
upvoted 1 times
...
Lantos
11 months, 1 week ago
In the case of "AuthType Basic" Apache will read a hashed password from the password file, so a hashed password should be stored in the password file! In the situation mentioned by the task, access denied will be the result because of a wrong password. (Answer D is true) We should make a difference between .htpasswd and .htaccess!
upvoted 3 times
...
shawarov
1 year ago
A according to chatGPT
upvoted 1 times
...
lbellic
1 year, 1 month ago
Selected Answer: A
The answer is A : assuming that the command htpasswd is executed with option "plain text" (-p) cause the file cannot be manually created
upvoted 1 times
...
EMordenti
1 year, 12 months ago
The option "A" is the correct answer. The password field in the ".htpasswd" file, if generated by the "htpasswd" command, is not stored in plain text by default, but can be used by providing the "-p" parameter. The "htpasswd" command uses MD5 hashing by default (parameter "-m") and the ".htpasswd" file will look like this usera:$apr1$FMvyPFsQ$CQNQc/lfAiHNaOIjA6a.K/ For additional security, bcrypt is often used for the hash (parameter "-B") and the ".htpasswd" file would look like this usera:$2y$05$7svvma1IcvF1PMBI4HW2EOcFH9Vguhh73S4xEMGhhv5Xn7fUFM1DK The ".htpasswd" file provided in the question shows that it uses clear codes to store passwords. If "Require" is set to "valid-user", any user present in the ".htpasswd" file will be able to access the resources in the file by providing the correct password. If the user's password is not validated, an HTTP 401 (Authorisation Required) status will be returned.
upvoted 3 times
...
Armina
2 years, 1 month ago
Selected Answer: E
E 100%. is correct Because “ AllowOverride” is by default none which make the use of “.htaccess” file completely disabled!.
upvoted 2 times
m2t4eus
10 months, 1 week ago
" Given that all these files were correctly processed by the web server processes"
upvoted 1 times
...
...
Armina
2 years, 2 months ago
Selected Answer: E
E is correct!
upvoted 2 times
...
Armina
2 years, 2 months ago
In other words in Apache only when AllowOverride is set to allow the use of .htaccess files (AllowOverride all) , httpd will look in every directory for .htaccess files. Please see the default setting which make the use of “.htaccess” file completely disabled!. in Ubuntu/, Debian Directory /var/www/> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory> on CentOs: <Directory "/var/www"> AllowOverride None # Allow open access: Require all granted # Further relax access to the default document root: <Directory "/var/www/html">
upvoted 1 times
...
Armina
2 years, 2 months ago
- Please notice also that the AllowOverride line is just in a <Directory> block in httpd.conf Which is not part of question. It tells Apache to process the htaccess file and to allow htaccess to set the authentication for that directory. Supposed AuthConfig is set like following: # AllowOverride AuthConfig, If you don't enter correct credentials, you will be continually prompted to enter credentials until you enter correct credentials or click the Cancel button. and if and only if is the question for Apache httpd 2.4, the authorization mechanism is by default “non” or as follows: # AllowOverride None, which allows public, non-restricted access for a specific directory and a configuration uses basic HTTP authentication if and only if we have NOT created a .htaccess file. That means if we have created a .htaccess file Apache prefer to allow users set in access file with prompting for password.
upvoted 1 times
...
Armina
2 years, 2 months ago
Selected Answer: D
D is correct! we have created a .htaccess file and set the contents of the file to be: # AuthType Basic # AuthName "Authentication Required" # AuthUserFile "/etc/htpasswd/.htpasswd" # Require valid-user - Notice: It was just used wrongly the same content of htpasswd which is “s3cr3t” which causes the problem of “Answer D” and password is not correct.
upvoted 4 times
...
Tomba
2 years, 4 months ago
https://httpd.apache.org/docs/2.2/misc/password_encryptions.html Ansert A cannot be correct since clear-text passwords are only supported (though discouraged) on Windows etc. The only question is a space in parameter value there on purpose
upvoted 1 times
...
linuxkr
2 years, 7 months ago
If the password field in the ".htpasswd" file is generated using the "htpasswd" command, it will not be saved in clear code by default, but clear code can be used by providing the "-p" parameter. From the ".htpasswd" file provided by the title, it can be seen that it uses clear codes to store passwords. If "Require" is set to "valid-user", any user who exists in the ".htpasswd" file can access the file resources by providing the correct password. If the user password authentication fails, the HTTP 401 status (Authorization Required) will be returned. Therefore, option "A" is the correct answer.
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...