Create a folder under different user directory

Hello All,

I have to write a shell script and use it in informatica. The script has to perform below actions:

  1. The script gets executed from edw user.
  2. Through the script, a DT folder has to be created under edw_sca user.

Is this scenario possible through a SHELL script or not.

Please help me with a dummy script.

Thanks
Biswajeet

Folders created by edw user will belong to edw user. It's possible to have the group changed automatically for you, but not the user. To create folders as edw_sca you will need to have edw login as edw_sca somehow, perhaps with sudo, i.e. sudo -u edw_sca mkdir /path/to/newfolder You will have to allow edw to run mkdir as edw_sca user in sudo. Changing sudoers requires admin access.

What have you tried?

Alternatively edw_sca could create a directory writeable by edw. As Corona688 points out files in this directory will still belong to edw and may be difficult to move or delete.

scp is also a possibility but opens a whole new kettle of fish with respect to security if not done correctly.

Andrew