Cognitive Neurophysiology Laboratory

CNL Wiki

Docs: Setting permissions on Hoffman to share data

Updated on October 4, 2024

Open terminal (or other command window software)
>> ssh username@hoffman2.idre.ucla.edu

enter password
>> cd /u/project/ifried/data/PIPELINE_vc
>> chmod –R 770 *
>> cd ../PATIENT_DATABASE
>> chmod –R 770 *

Note:

‘chmod’ means “change permissions”
‘-R’ means do it recursively into all subdirectories
‘770’ means set permissions to read, write, and execute for yourself and everyone in the ifried group, and no one else.
‘*’ means set it for all files in the directory (and subdirectories, if you used –R)

You could also just run this from the data folder instead of running it once from PIPELINE_vc and once from PATIENT_DATABASE. It will take longer, but doesn’t require any intermediate attention (once you run chmod once, you can leave and it will change all your permissions). Also, if you are logged in as if_xfer, you should NOT do that. Run as described above.

Setup to Run the Permission Change Bash Script
#

It can be inconvenient to frequently run commands to change file permissions. To make this easier, we have a bash script available on Hoffman: /u/project/ifried/data/server_utilities/change_permission.sh.

You can configure your environment to run this script from any directory by updating your .bashrc file.

Steps: #

  1. Open your .bashrc file by running vi ~/.bashrc.

  2. Press i to enter insert mode and add the following line to include the script’s directory in your PATH:
    export PATH=$PATH:/u/project/ifried/data/server_utilities/

  3. Press Esc, then type :wq, and press Enter to save the changes and exit vim.

  4. Apply the changes by running source ~/.bashrc.

Now, you can navigate to any directory and run the change_permission.sh script by simply typing:
change_permission.sh.

This will change the permissions of all files and subdirectories in the current directory that belong to you.

Optional: Specify a Directory #

You can also specify a different directory by providing it as an argument:
change_permission.sh "/path/to/your/directory".