Release Automation

Expand all | Collapse all

User Impersonation

  • 1.  User Impersonation

    Posted Jul 06, 2018 10:08 AM

    I need assistance in a scenario where I want to perform some activities (Copy, Remove, Check file or folder exist, create Directory) in m00431 user while i am login on server with capio user. Can someone assist on this?



  • 2.  Re: User Impersonation
    Best Answer

    Broadcom Employee
    Posted Jul 08, 2018 10:20 PM

    Hi,

     

     

    Did you try to configure with following document?

    Deploy Agents - CA Release Automation - 6.6 - CA Technologies Documentation 

    • Install Unix / Linux Agent to Run as Non-Root User
      • Run Processes Under Different Users – Unix/Linux
      • Run Processes Under Different Users – Windows

    https://docops.ca.com/ca-release-automation/6-6/en/administration/set-up-users-and-permissions

    If you already tried above steps and faced any problems, please share your error and situation.

     

    Cheers

    Yas



  • 3.  Re: User Impersonation

    Broadcom Employee
    Posted Jul 11, 2018 10:12 PM

    Hi,

     

    Did my answer cover your question?

    If so, please click "Mark Correct" on the answer. If you need additional help, please share your attempt and situation.

     

    Thanks in advance.

    Yas



  • 4.  Re: User Impersonation

    Posted Aug 03, 2018 09:03 AM

    I need assistance in a scenario where I want to perform some activities (Copy, Remove, Check file or folder exist, create Directory) in m00431 user while i am login on server with capio user. Can someone assist on this?

     

    After doing all the changes which is mentioned on https://docops.ca.com/ca-release-automation/6-6/en/administration/set-up-users-and-permissions, i I tried Copy activity using run command line from capio user to m00077 but the action ran successfully with permission issue (without copying files from capio to m00077). Can you help on this.



  • 5.  Re: User Impersonation

    Broadcom Employee
    Posted Aug 03, 2018 09:25 AM

    HI Prashant,

     

    The url i'm about to provide doesn't cover this error. But it covers other errors that are sometimes encountered when using user impersonation. 

    Verify the user running Nolio agent has privileges to impersonate other users" error

     

    As for the error that you're getting, could you show us:

    1. The configuration of the action (settings/properties tab for which user you're using). 
    2. While logged into cappoc.snt.bst.bls.com as the user from #1, the output of the command: id
    3. An 'ls -la' output of /home/capio/akanksha/BBGW/netmap_mkp.cfg

     

    Thanks,

    Gregg



  • 6.  Re: User Impersonation

    Posted Aug 03, 2018 09:55 AM

    Hello Gregg,

    1)The configuration of the action (settings/properties tab for which user you're using). 

    2)While logged into cappoc.snt.bst.bls.com as the user from #1, the output of the command: id

    3) An 'ls -la' output of /home/capio/akanksha/BBGW/netmap_mkp.cfg



  • 7.  Re: User Impersonation

    Broadcom Employee
    Posted Aug 03, 2018 10:14 AM

    Hi, 

     

    Based on that output it appears that m00077 might not have permissions to that file. You might want to try taking CA Release Automation out of the equation to just get things working manually first. Login to cappoc.snt.bst.bls.com as m00077. Then try to copy /home/capio/akanksha/BBGW/netmap_bkp.cfg to the directory where you want it to go. This should be done while logged in m00077 - not capio since you are configuring the action to run as m00077.

     

    Kind regards,

    Gregg



  • 8.  Re: User Impersonation

    Posted Aug 03, 2018 10:33 AM

    Hi Gregg,

     



  • 9.  Re: User Impersonation

    Broadcom Employee
    Posted Aug 03, 2018 11:40 AM

    Hi Prashant,

     

    Thanks. That confirms that this is an environment problem. Please coordinate an appropriate solution with your linux admins. I could tell you run the following as capio: chmod 777 /home/capio/akanksha/BBGW/netmap_bkp.cfg

    But that would be a bandaid and you'd likely just hit a new error shortly after that if you have other copies, etc.. that you need to perform. I think speaking with your Linux admin team would result in a more thorough conversation and strategy based on your overall needs.

     


    Kind regards,

    Gregg



  • 10.  Re: User Impersonation

    Posted Aug 06, 2018 02:27 PM

    Hello Gregg,

    I tried same after changing file permission with 777.



  • 11.  Re: User Impersonation

    Broadcom Employee
    Posted Aug 06, 2018 02:31 PM

    Hi Prashant,

     

    I would have expected that to work - even if only for that one file (which I never considered a solution). For a solution, to get to the root cause of why that manual copy is not working in your environment please consult with your linux admin.

     

    Kind regards,

    Gregg



  • 12.  Re: User Impersonation

    Broadcom Employee
    Posted Aug 06, 2018 09:41 PM

    Hi Prashant,

     

    I agreed with Gregg.

    I think m00431 user doesn't have the execution permission (+x) for /home/capio/akankaha/BBGW as parent directory.  Please check the permission without RA.

     

    Regards

    Yas



  • 13.  Re: User Impersonation

    Posted Aug 07, 2018 09:13 AM

    Hello Yasuyuki,

     

    How we can check permission without RA? Please suggest.



  • 14.  Re: User Impersonation

    Broadcom Employee
    Posted Aug 07, 2018 09:22 AM

    Hi Prashant,

     

    Since you're having problems when you take RA out of the equation you need to consult your Linux/Unix admin. Once the problem is solved outside of RA then it should work in RA. The steps we suggested above are how you would "check" without RA (the things we asked you to do manually on the specific machine). But those things didn't help - even the things that should have. That's why we're suggesting you consult with your Linux/Unix admin. We don't mind helping with problems that aren't specific to RA but cause problems inside RA. But when something should work outside of RA but doesn't then the experts (like your linux admins) should be consulted which will hopefully not only solve this one specific problem but also prompt a larger conversation between the two of you where they understand all of your needs and ensure you don't have environment problems for other steps. 

     

    Kind regards,
    Gregg



  • 15.  Re: User Impersonation

    Broadcom Employee
    Posted Aug 07, 2018 10:47 PM

    Hi,

     

    I believe your problem is not application level (RA) but OS level. So, I also recommend to discuss with OS administrator.

    You can check the permission using command "ls -alF".

     

    In my example, I want to copy a file from /opt/test/src/a.txt to /opt/test/dest as b.txt.

    The owner of /opt/test/src directory is root. In this case, the permission of src (./) directory is 644.

     

    Switch user from root to other user ("oracle" in following screen.).

    In this case, same error is occurred - "cannot stat".

    If the permission of src directory is changed to 755. ("chmod 755 /opt/test/src" by owner - root)

    In this case, "oracle" user tried to copy, and then another error is occurred - "cannot create regular file". 

    Because the user doesn't have write permission to target directory (/opt/test/dest).

    If grant write permission to dest directory, ("chmod 777 /opt/test/dest" by owner - root.)

    You can copy the file and the owner is creator.

     

    I hope my case study helps you.

     

    Thanks

    Yas