UCO/Lick logo
UNIVERSITY OF CALIFORNIA OBSERVATORIES / LICK OBSERVATORY

Network, Information, and Computing Services

Changing Unix File and Directory Permissions

  1. Using an SSH Client such as F-Secure, open a connection to odin. Use the same login and password you'd use on bigdog or isis.

  2. Move the directory containing your new directory. Most of odin's NT shares begin in /u/loen . deimos, dwg and dwg2 live there.

  3. [Assuming that '%' is the prompt, type as follows:]
    % cd /u/loen/dwg2
    % cd hires
     
  4. Confirm your location.

  5. % pwd
    Odin should return: /u/loen/dwg2/hires
     
  6. List the permissions for your directory.

  7. % ls -l HIRES-CCD <= or
    % ls -l |more     <= shows all directories in hires
     

    Sample output:
    % drwxrwsr-x 5 loen DOS---- 512 Sep 5 15:10 HIRES-CCD
      ^ <= d for directory ('-' = file; 'l' = link)

    % drwxrwsr-x 5 loen DOS---- 512 Sep 5 15:10 HIRES-CCD
       ^^^ <= user's (aka owner's) permissions (readable, writable,
    executable/traversable)

    % -rw-r--r-- 1 loen DOS---- 89088 Dec 31 1969 schedule.doc
          ^^^ <= group permissions (NT groups are readable, not writable, not
                 executable)

    % -rw-rw-r-- 1 loen DOS---- 89088 Dec 31 1969 schedule.doc
             ^^^ <= world (all) users' permissions
                   (readable, not writable or executable)

    NOTE: web pages must be world readable.
    NOTE: world _writable_ is not recommended!
     

  8. OK, so fix this, finally!
    1. For files:

    2. % chmod g+w schedule.doc <=add group write permissions
       
    3. For directories:

    4. % chmod g+wx HIRES-CCD <= add group write permissions
                               -- let any one in the electronics
                               or engineering NT groups view files
                               and change or add files.

      NOTE: If you ever need to remove group write or read permissions, please let me know right away, so I don't accidentally clobber your changes!
       

    5. Make your changes recursive (descend into directories, change all of their contents) 

      % chmod -R g+wx *


    6. In our example, this command would make ALL directories in /u/loen/dwg2/hires group-writable.
Last modified on Friday, 06-Sep-2002 13:40:47 PDT