I don't know anything about Unix but I have to create a htaccess file and a htpasswd file. I have instructions that tell me to "create an htaccess file using the vi editor" How do I get into the directory that should be password protected and how do I start creating the htaccess file? If I can get these two things answered, I think I will be okay, but if there is anyone who wants to offer more info, that would be great too!
Sorry, I'm such a dummy - but I hope someone can help me.
The "pico" editor would be easier to use if it is available on your system.
Try:
cd <directory_name>
pico .htaccess
If you do not have pico, then:
vi .htaccess
Once in vi, hit "i" to enter insert mode. type your text.
Hit the escape key to leave insert mode, then ":wq!" to write to disk and exit. If you prefer to quit without saving, it would just be ":q!"
Create the .htpasswd file with something like:
htpasswd -c /your/home/directory/.htpasswd username
Another good option to set for the vi newbie is showmode. This will show you whether you are in insetr mode etc. To do this, type
:set showmode
once you open vi.
Sounds like your user does not have write permissions to the directory (or to the .htpasswd file if it exists). From the directory where the .htaccess file exists, type;
ls -ld .
You are looking for either group or user write permissions;
drwxrw-r--
If there is no w in the third or sixth position, type;
chmod ug+w .
If that checks out type this from within the directory that the .htaccess exists;
ls -la .htpasswd
If it exists, examine the permission and correct as above.