|
It is important to realize that the servants are formed so that by means of the World Wide Web, any person from any point of the world to any hour can accede to any file put in her space Web. Nevertheless, there are two methods to restrict the access. These are only available for clients with virtual dominions.

The access to a directory can be restricted. For example to enter the http://neathosting.net/prohibido/ directory, it is necessary to write the name of user (username) classic and the password (password) Web
How to do it?
He is a little complicated - it is not for nascent:
-
.htaccess writes a called file like this:
AuthUserFile /web/guide/dnet/manzanas/.htpass AuthGroupFile /dev/null AuthName “Restricted Access� AuthType BASIC <Limit GET POST> require to user classic </Limit>
It puts the name complete of the directory where it is going to put the file of passwords instead of /web/guide/dnet/manzanas. It puts what wants after AuthName and the name of user required instead of classic.
-
.htaccess to the directory transfers the file who wants to restrict. It must transfer it in way ASCII (text). If it is using TWO or Windows, can have difficulties to create a file with the name .htaccess. It creates it with the .htaccess.txt name and after transferring it, it changes the name .htaccess. In addition, this file must be writing in format text, not in format text MSDOS. Once transferred, it will seem that the file has disappeared. This is because the files that begin with a point are hidden by the system. It can see it from SSH with commando ls -.
-
It connects to his dominion by SSH and creates the directory where it wants to locate the file of passwords, and soon changes to this directory. For example:
to mkdir apples CD apples
-
The commando writes to create the file of passwords:
htpass - c .htpass classic
Classic by the name of required user replaces
-
The servant will ask to him:
Adding password for classic New password: the password writes here. It will not appear in the screen Re-type new password: the password writes again
This is the most basic configuration. NCSA has more details. It notices that in our system, htpass is necessary to use the program to create the file .htpass, not htpasswd. In addition, these files with FTP are not seen. Nevertheless, they are possible to be seen with SSH writing ls -.
This method only restricts access by the Web. Meaning that other users of the servant will continue having access this directory. In order to protect his more confidential archives, it is necessary to use method 2.
Multiple users
If he wants to give access to more of a user, follows the steps above indicated, but with these changes:
-
.htpass puts more users in the file using the commando htpass without option - c p.ej.
htpass .htpass Juan htpass .htpass alberto htpass .htpass elena
-
.htgroup with a list of the users creates a file of called group (póngalo in the same directory who .htpass
friendly: classic Juan alberto elena
-
.htaccess modifies the file thus:
AuthUserFile /web/guide/dnet/manzanas/.htpass AuthGroupFile /web/guide/dnet/manzanas/.htgroup AuthName “Restricted Access� AuthType BASIC <Limit GET POST> require group friendly </Limit>
Now only “the friendly� members of the group can accede to the directory

With this method the reading can be prohibited files. For example it tries to read prohibido.html. Also it is possible to be used to prohibit to read a directory, but for total security, it must prohibit to read the directory and the files inside.
-
It connects by SSH to his dominion
-
fichero.htm writes chmod 600 or what is.
More information on permissions
|