Gentoo Archives: gentoo-user

From: Kevin O'Gorman <kogorman@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] SSH hosed, only rubble remains
Date: Sun, 28 May 2006 16:34:26
Message-Id: 9acccfe50605280921x48f97f07xb5f3215d08b30646@mail.gmail.com
In Reply to: Re: [gentoo-user] SSH hosed, only rubble remains by John Jolet
1 On 5/27/06, John Jolet <john@×××××.net> wrote:
2 >
3 > That does not work for ssh/scp sessions. I usually test $PS1 to tell
4 > > if it's really a shell -- the variable does not even exist for an
5 > > scp session,
6 > > although .bashrc gets called.
7 > can you give us an example of what your .bashrc looks like?
8
9
10 Well, the whole thing is kinda long, but the part I was fooling with lately
11 now looks like this, and partly automates the use of ssh-agent for my
12 (very frequent) use of ssh from home to some machines at work. The
13 problem was probably either the "echo" commands or that this actually
14 proceeds within a subshell.
15
16
17 if [ "x" != "x$PS1" ] ; then
18 SHELL_LOGIN=1
19 else
20 # Probably scp; empty string is false
21 SHELL_LOGIN=
22 fi
23
24 if [ -n "$SHELL_LOGIN" ]
25 then
26 if [ -z "$SSH_AGENT_PID" ]
27 then
28 # not yet running in ssh-agent
29 ssh-agent /bin/bash
30 r=$?
31 echo Done with ssh-agent
32 sleep 1
33 exit $r
34 else
35 # this is an ssh-agent subshell
36 echo You may want to run ssh-add.
37 fi
38 fi
39
40 --
41 Kevin O'Gorman, PhD

Replies

Subject Author
Re: [gentoo-user] SSH hosed, only rubble remains John Jolet <john@×××××.net>
Re: [gentoo-user] SSH hosed, only rubble remains "Bo Ørsted Andresen" <bo.andresen@××××.dk>