.htaccess & .htpasswd

I have this project where I have a front and back. My login file is simple if the login and password are in my database then I'm directed to a page in the back, otherwise I can't go.
I login into the backoffice without a problem but I wanted to protect the back and directories.

I'm trying to lock my backoffice with .htaccess which worked I can't access the backoffice directories but I also can't login anymore.

Here are my two files.

Content of .htaccess:

Deny from all 
Options -Indexes


AuthType Basic
AuthName "KW"
AuthUserFile /.htpasswd
Require valid-user

Content of .passwd:

root:passwordhere

AuthUserFile /.htpasswd

In addition to the "typo" as mentioned in @Glorfindel's answer (.htpasswd vs .passwd), the argument passed to the AuthUserFile directive should be an absolute filesystem-path, not a document-root relative URL-path, as you appear to be using here.

See my answer to a related question on ServerFault for an example. See also my answer to a similar question on StackOverflow that goes into more detail.

Errors with HTTP authentication are very often caused by using an incorrect file-path to the password file.

However, you also need to remove the Apache 2.2 Deny from all directive on the first line. By default, on Apache 2.4, this will override the Require directive and block all access with a 403 Forbidden - the prompt for a password is suppressed.