Profile Permission Errors During Subscription


If you get an error warning that you don't have permission to modify ~/.profile during the ssm subscribe step of these instructions, the problem is probably a result of the fact that each user's ~/.profile is linked into the profile-setup_1.0_all package in order to replicate the RPN environment. The best solution to this problem would be to provide an additional argument to the ssm subscribe --user command that allows the user to specify which user setup file he/she would like SSM to modify. Since that option doesn't exist, a workaround is presented here.

  1. Back up the existing setup: cd ~; mv -f ~/.profile ~/.profile_ec.backup
  2. Copy the linked file to a full copy of the setup: cp -L ~/.profile_ec.backup ~/.profile
  3. Make sure that you have write permission for the ~/.profile file, then rerun the subscription: ssm subscribe --user -d $GEMSSM
  4. Use diff to compare the new and old setups (there should only be a few lines of difference with an "automatically added" note. diff ~/.profile_ec.backup ~/.profile
  5. Cut and paste this block of difference from ~/.profile to ~/.profile_usr, your personal setup file.
  6. Remove the copied setup file: rm -f ~/.profile
  7. Move the linked setup back to its original location: mv -f ~/.profile_ec.backup ~/.profile
  8. Log out and log back in.

That seems like a lot of work, but it only needs to be done once. You can ignore subsequent complaints about file permissions from SSM once you have completed these steps, since the actual subscription is handled in the ~/.ssm.d/profile file, the path to which is set by this workaround.