202-450 Exam QuestionsBrowse all questions from this exam

202-450 Exam - Question 74


There is a restricted area in a site hosted by Apache HTTPD, which requires users to authenticate against the file /srv/www/security/sitepasswd.

Which command is used to CHANGE the password of existing users, without losing data, when Basic authentication is being used?

Show Answer
Correct Answer: AB

To change the password of existing users without losing data in Apache HTTPD, you should use the htpasswd command without any additional parameters that create or delete files. The -c option creates a new file, which would overwrite the existing file and result in data loss. Therefore, the correct command is htpasswd /srv/www/security/sitepasswd user, which will update the password of the specified user in the existing file.

Discussion

6 comments
Sign in to comment
FabelhaftZuverlaessigerGorillaOption: B
Jul 22, 2020

Should be B as -c creates a new file.

lite2000
Jul 25, 2020

The -c argument is in option A so A is correct

glorofarz
Jul 28, 2020

B is correct, as you will find out in reality just tried it here on deb10 the -c option will nuke the file, and it will only contain the entry of the user of the commandline, all previous will be GONE.

usandoatiOption: B
Jul 31, 2020

It's the -c that makes it create a NEW password file, Then B is correct

jorge_pasOption: B
Nov 13, 2021

Should be B. https://linux.die.net/man/1/htpasswd -c create new file, -D delete user, -n is a test comand without arguments add o modify usuer

remisetOption: B
Nov 15, 2022

The question tell about modify, not create, then, you must use httpd without options, else, will create the file with new user.

shawarovOption: B
Mar 23, 2023

B for sure

LantosOption: B
May 14, 2023

From documentation: Examples htpasswd /usr/local/etc/apache/.htpasswd-users jsmith Adds or modifies the password for user jsmith. The user is prompted for the password. The password will be encrypted using the modified Apache MD5 algorithm. If the file does not exist, htpasswd will do nothing except return an error. Ref: https://httpd.apache.org/docs/2.4/programs/htpasswd.html