You’re probably right–I could have removed the password-protection and then uploaded the file. But I managed to sort out the command line process, and here’s what I did:
- Remove the password protection through the Web Panel.
- Telnet to my domain.
- Change to the directory I wanted to password-protect by typing ‘cd path/to/directory’. You can type ‘ls’ to list the files and directories in the current directory–that’s like ‘dir’ to DOS users. Modify it like this: ‘ls -a’ to show hidden files, like .htaccess.
- Start a text editor. Forget vi or emacs, pico was more my speed. Type ‘pico’.
- Enter the text for the htaccess file. All I wanted to do was have something besides ‘Custom’ show up when the password prompt popped up, so all I had to do was copy the old .htaccess file contents and modify the relelvant info (after ‘AuthName’):
AuthName "My Password-Protected Area"
- Type ‘Ctrl-X’ to finish editing. Pico will ask you if you want to save the file. Type ‘Y’, and type the name of the file to be saved (’.htaccess’). You’ll return to the command line.
- Create the .htpasswd file: type ‘htpasswd -c .htpasswd username’ where ‘username’ is the username you want to use. It will prompt you to enter the password twice. Then you’ll be all set.
This process is simple enough with instructions, but the disadvantage is that you can no longer modify access to that directory via the Web Panel.