I haven't been able to find a question that describes this specific scenario.
I am trying to execute a very basic bash script to retrieve logging from multiple machines. I am running the script locally but need to access an external machine via ssh, as well as sudo into a privileged user once on that machine...
ssh [email protected] sudo su - privledged_user cat logs > file.txt Running this with sh -x reveals bash is getting stuck on the 'ssh' line. So I tried revising it to this:
ssh [email protected] sudo su - privledged_user cat logs > file.txt This also seems to stall indefinitely. Is there a better solution to this problem?? I don't see a way around using sudo su from what I can tell...
Thanks for any help!