Custom Search

Tuesday, December 16, 2008

Lock Folder...By restricting user access rights.......

By using this method you can restrict user for accessing any particular folder or file........You don't need any password to lock it......

Having some amount of pre-knowledge of DOS would help you to understand this method.

We can restrict user access rights by using 'cacls' command (Access Control Lists).....

Example: Suppose you want to lock a folder named 'lock' which is located in D directory.

Step 1: Open command promt by entering 'cmd' in the run tab which is present in the Start menu.

Step 2: Command promt window will ope with a black screen showing path something like

'c:\Doument and Settings\User_name\Desktop' . Type D: and press enter

Step 3: Now the path will change to D:\

To lock:-Type the comand as below

D:\>cacls 'Folder_name/File_name' /D 'user_name_whose_access_is_to_be_restricted'

Here, D:\> cacls lock /D everyone. '/D' is to deny permission to acces it.

Step 4: 

To Unlock:- Typr the following command

D:\>cacls 'Folder_name/File_name' /P 'user_name_whose_access_is_to_be_restricted':F

':F' is to give full permission (Read, write, etc)

Hope this information was beneficial for you. 'cacl' is breifly explained below:

CACLS.exe

Display or modify Access Control Lists (ACLs) for files and folders.

Access Control Lists apply only to files stored on an NTFS formatted drive, each ACL determines which users (or groups of users) can read or edit the file. When a new file is created it normally inherits ACL's from the folder where it was created.

Syntax
CACLS pathname [options]

Key options can be any combination of:

  /T Search the pathname including all subfolders. 
  /E Edit ACL (leave existing rights unchanged)
  /C Continue on access denied errors. 

  /G user:permission
  Grant access rights, permision can be: 
  R Read 
  W Write
  C Change (read/write) 
  F Full control 

  /R user
  Revoke specified user's access rights (only valid with /E). 

  /P user:permission  
  Replace access rights, permission can be: 
  N None
  R Read
  W Write
  C Change (read/write) 
  F Full control 

  /D user
  Deny access to user. 

  In all the options above "user" can be a UserName 
  or a Workgroup (either local or global)

  If a UserName or WGname includes spaces then it must 
  be surrounded with quotes e.g. "Authenticated Users"

  If no options are specified CACLS will display the ACLs for the file(s)

No comments:

Post a Comment