Prompt containing SSH login information

Polytropon freebsd at
Tue Nov 24 04:10:41 UTC 2009


again, a strange question: I'd like to know if there is a builtin
means to let the csh's (or bash's) prompt show an information if
the current dialog session has been opened via SSH from another
system. The obvious is:

	me at sys1:~% ssh me at sys2
	me at sys2:~% _

I'd like the second prompt that I've been logged into sys2 by
sys1, such as

	me at sys1>sys2:~% _

or reverse

	me at sys2<sys1:~% _

or something similar, like the complex form with different user
names, such as

	me at sys1:~% ssh bob at sys2
	me at sys1>bob at sys2:~% _

Is this possible with the means given by the shell? I read "man
csh", but found nothing that would fit.

Maybe it's not possible (because not intended)...

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

More information about the freebsd-questions mailing list