[clue-tech] Question for script wizards
Sean LeBlanc
seanleblanc at comcast.net
Thu Apr 9 21:09:05 MDT 2009
On 04-09 20:34, Dennis J Perkins wrote:
> On Thu, 2009-04-09 at 17:26 -0600, Sean LeBlanc wrote:
> > On 04-09 22:32, dennisjperkins at comcast.net wrote:
> > > I've never thought about it and I don't really use ssh since I have
> > > nothing to ssh to, but wouldn't you get the login shell that is specified
> > > for you in /etc/passwd? If so, can you change your login shell on each
> > > remote host?
> >
> > I would, but it's the same user on the host. In other words, shared. I find
> > myself typing "bash" everytime I log in. There is some other config I'd like
> > to do to, too, but that's the first thing.
>
>
> Try checking TERM. I suspect when you are logged in locally, you are
> using a desktop environment and a KDE or GNOME terminal program. If so,
> is your remote login shell different? If yes, try this:
>
> if [ "$TERM" = "term" ]; then
> exec bash
> fi
It would be the same for all other staff using this same machine and user.
They all come in via ssh. Only real difference is what machine they are
starting the ssh client from.
I wasn't having any luck with tty or who or whoami. Maybe there is something
about those that I don't know, though.
I think I may have found what I need to do, although I haven't done it yet.
Apparently, ssh (usually according to man page) sets some vars. One of which
is SSH_CONNECTION.
I'll parse that, find out what the client ip is, and then, based on that, I
can decide to invoke bash or not in one of the scripts. Probably
.bash_profile?
--
Sean LeBlanc:seanleblanc at comcast.net
http://sean-leblanc.blogspot.com
More information about the clue-tech
mailing list