Using a jump box, is it possible to sudo su - to root before connecting to targets?

50 views
Skip to first unread message

Agent Gh

unread,
Sep 17, 2015, 6:42:49 AM9/17/15
to Ansible Project
From our jump box, we sudo su - to root and then ssh into the other hosts as root.  (I understand the security risks, but I don't have control over this setup)

I'm wondering if I can setup ansible to that it connects to the jump box as my user, then does a sudo su -, so that when it sshes over to the targets, its actually connecting to them as root.


I know it's possible to use proxycommand to make use of a jump box, but the sudo su -, I haven't figured out.

The only variable I can control here is the box I'm originating from. Details that I don't have control over:
  • I can't install ansible on the jump box.
  • My user isn't on the target hosts, only root.
  • Root password is not known, we use private keys, which are only on the jump box.
  • I cannot copy those keys to my box.
  • I can't ssh to the jump box as root.

Chris Grigor

unread,
Sep 17, 2015, 6:55:54 AM9/17/15
to ansible...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/6ee5ec4c-c6a5-44aa-94ea-e79434d3278f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Agent Gh

unread,
Sep 17, 2015, 9:12:30 AM9/17/15
to Ansible Project
I have actually. In his example, he's just connecting through a jump box, he isn't connecting and then becoming root before connecting to the targets.
Reply all
Reply to author
Forward
0 new messages