Prompt containing SSH login information

Polytropon freebsd at edvax.de
Tue Nov 24 08:34:46 UTC 2009


On Mon, 23 Nov 2009 23:22:47 -0800, George Davidovich <freebsd at optimis.net> wrote:
> I'd suggest parsing out w(1), or better yet, making use of environmental
> variables instead.  The following, for example, are set by ssh:
> 
>   SSH_CLIENT
>   SSH_CONNECTION
>   SSH_TTY

That sounds interesting, I'll research on this further.



> Out of curiosity, why are you wanting to do this?  Are you chaining
> connections and need an analog of SHLVL for ssh connections? 

Quite. Because most of my systems look uniform (prompt and
other things), I'd like to immediately know where I am,
especially when I need to "walk" subnet paths (which
sometimes is a security requirement - one server that
allows SSH from external, all connected clients only
allow SSH from local network), so I think it would be
good to know what's exactly going on. I think the prompt
is the most obvious thing to put those informations, because
I'm looking at it anyway.



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list