1

Does anyone know of a shell that would show a series of breadcrumbs as I navigate into/out of various servers, like this:

Home > Build Machine > Vagrant > Docker-base

Hopefully it could auto-detect logging in and out of various boxes and display the hostnames. Perhaps with a simple "no circular links", one could just try and monitor the hostname, but I don't know if there is a shell that can easily act as a 'parent' to the other shells on these various systems so that it can query hostname and/or other item. Any thoughts?

  • 1
    Keep in mind that if you SSH (I am assuming this is what you mean by "navigate"), you execute the shell on the remote host, and during that time, your shell on the host you SSH from is waiting for that to be done and is totally inactive. – Falcon Momot Nov 2 '13 at 0:24
  • 1
    Checkout out the SSH_CLIENT and SSH_CONNECTION environment variables. – Cristian Ciupitu Nov 2 '13 at 4:14
  • 1
    Also the pam_env.conf(5) man page has this in the examples section: set the REMOTEHOST variable for any hosts that are remote, default to "localhost" rather than not being set at all: REMOTEHOST DEFAULT=localhost OVERRIDE=@{PAM_RHOST}. – Cristian Ciupitu Nov 2 '13 at 4:21
  • Thanks everyone - these all look interesting. I'll have to do some reading to see if I can figure out how to use one of them to my advantage. I think @FalconMomot hit the nail on the head though - this fundamentally requires some sort of "super shell", even if all it's doing is watching the character stream you're inputting for keywords – Hamy Nov 2 '13 at 5:45
  • You could also look for some mechanism that allows you to pass some arbitrary string in from the computer opening the SSH connection, somehow (by setting the target shell perhaps), which could then be taken up by the target .bashrc. I can't say what this might look like off the top of my head. – Falcon Momot Nov 2 '13 at 8:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.