Carl Johnson on 28 Oct 2015 09:47:03 -0700
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
- From: Carl Johnson <email@example.com>
- To: PLUG <firstname.lastname@example.org>
- Subject: [PLUG] some bash help
- Date: Wed, 28 Oct 2015 12:46:18 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=/lE93xBsNW6OCaFaJgHDXbHgGrfbD1WLoI+E4QvRJtc=; b=Krr2JT+4bpaICpnQpc/JcitB6kyn403quJb14EzxWSLLvio/hymtXnW5OYY66pxTi9 F86nmrp5s06Y6QGEOTa0MF1ocu9S9CwZTvE4g7PmIEDCcqjMGr/0maxuB4gGwmd9/m/o eJMkgvMSFDbJqCz3pkpLUnor15YGTsPIQNZjCNZwH4KVNNLwHBb+keoNWjYdlNRkKf3O 6T9iiRpcON08CObRpkdlRrbWuaqV18m/fsCLlOFH0cj29WxyMqahE3+B7fU4d3ZDzDEk sMvR8NEFTQnKpj+BRZTXYjJD3R1aLqOFg1xGk0PH4dJc2wDQ1MxehO96FKVTMuLQ8tFe DXyg==
- Reply-to: Philadelphia Linux User's Group Discussion List <email@example.com>
- Sender: "plug" <firstname.lastname@example.org>
I have a server that I need to use as a transparent jump box to another network. What I'd like to do is have a "serveradmin" user be able to SSH into "serverA" and automatically be SSH'ed into another server, "serverB". If this second ssh session to serverB is killed (i.e. ctrl+c) or dies for whatever reason I'd like the original ssh session to serverA to collapse too.
How can I do this? Is it even possible? Do I have to do some sort of if while true magic in .bashrc or what? Maybe the first server has to look for exit codes other than "0"?
I've gotten the easy part done already. I can SSH in as serveradmin but while at the login prompt of the second server if I ctrl+c I get dumped back into a bash prompt on the first server. What I'd like to do is prevent this recursion if possible.
Philadelphia Linux Users Group -- http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion -- http://lists.phillylinux.org/mailman/listinfo/plug