linux - rundeck - switch to root user in job script -
logging via terminal can switch root user fine:
ubuntu@ip-10-0-0-70:~$ sudo -s root@ip-10-0-0-70:~# whoami root
so created in rundeck job script this:
whoami; echo "1st step"; sudo -s; echo "2nd step";
and when run this, prints:
ubuntu 1st step
after print '1st step' stucked forever. seems problem sudo -s
command.
sudo -i
same happens tried sudo su - root
same happens rundeck logging ubuntu user, me too any thought switch root in rundeck script?
this expected behaviour. running shell via 'sudo -s' , not leaving/exiting ! waits forever somethig won't come.
you can add together 'sudo' advanced alternative of script (where says "run script interpreter or prefix. e.g.: sudo, time:"). run whole script root. if want specific command run root , prefix command sudo so:
sudo "enter_your_command_to_be_run_as_root_here"
linux amazon-ec2 rundeck
No comments:
Post a Comment