Have you done the same login into the server via root password on the machine?
You can try one more for the same.. as below
Create this as a .sh script and use file deploy job and execute the same in post script.
It worked for me earlier during some script deployment and execution.
Please share the output through the methodology which i have suggested
I think when you do:
su - azastmgt
it is waiting for the password to be entered, thus this behavior seems to be a hung behavior.
I think you are not mapped to "root" user on that target and thus the "su - USER" is prompting you for the password. Are you mapped to "root" on the target? What did rscd.log shows when you run the job?
Yes, the agent is mapped to root and i did checked it via network shell before proceeding with NSH Script job.
I had to do the slight modification in the script to get it working from NSH Script Job.
Had to put -c flag, plus the command which we are running should be into ' '
New syntax looks like below and works for me, thank you for every one's inputs
su - azastmgt -c 'mkdir –p ~/.ssh'
su - azastmgt -c 'echo ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDKG1Twel7tA6btP5CRAV5h5v7Z2xoJwvwsOAKqnH5j3fRk+hwj3Adz+w8e5xuDtCPinw92bITav+zouvwukerdt/ezkorqqZPttmh4mfr6a58ArrXCC/7n0VgSR4YvWCtack95Uw+k+/s4B7D71odXEtVoDTWx1nRdB/4EtW0L5bnTnOFtyzwzL2lnnS3AR4hQA3DDdbV3bPOz7XH/qNt9xupH7WQIJY8/ytd1zArc39laULRKK08jniMsWXAS9YkDgzxxigVAhszaiiWNtW4v43xB/9z22RSsVvebzX7a2VDXspgBG0tSXCG7RWyrlQ4h2Wmzh1tDTvHh8Y0syCa1 azastmgt@ukapx096 >> ~/.ssh/authorized_keys'
su - azastmgt -c 'chmod 600 ~/.ssh/*'