zsh-users
 help / color / mirror / code / Atom feed
* how to find out who I am
@ 2003-08-04 19:43 Andy Spiegl
       [not found] ` <75FEBB10-C6B4-11D7-9809-000393A707CC@eziba.com>
  2003-08-04 20:04 ` Fletch
  0 siblings, 2 replies; 8+ messages in thread
From: Andy Spiegl @ 2003-08-04 19:43 UTC (permalink / raw)
  To: ZSH User List

My colleague and I frequently ssh into our servers as root.
I'd like to find a way to let zsh distinguish between us, but
the environment variable SSH_CLIENT doesn't help because both of us
log in from workstations with constantly changing IPs.

Is there any other way how I can let zsh know who I am?

Thanks guys,
 Andy.

-- 
           http://peru.spiegl.de  Our project
      http://radiomaranon.org.pe  Radio Marañón, Jaén, Perú
                              o      _     _         _
  ------- __o       __o      /\_   _ \\o  (_)\__/o  (_)          -o)
  ----- _`\<,_    _`\<,_    _>(_) (_)/<_    \_| \   _|/' \/       /\\
  ---- (_)/ (_)  (_)/ (_)  (_)        (_)   (_)    (_)'  _\o_    _\_v
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 We are Microsoft.  Unix is irrelevant.  Openness is futile.
 Prepare to be assimilated.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: how to find out who I am
       [not found] ` <75FEBB10-C6B4-11D7-9809-000393A707CC@eziba.com>
@ 2003-08-04 19:58   ` Andy Spiegl
  0 siblings, 0 replies; 8+ messages in thread
From: Andy Spiegl @ 2003-08-04 19:58 UTC (permalink / raw)
  To: ZSH User List, Jay Sachs

Jay Sachs wrote:

> What about
> 
>   ssh -t me@my.host.name sudo -s

Nice idea!  But it doesn't work, because we don't have user accounts on
these machines.

Thanks,
 Andy.

-- 
           http://peru.spiegl.de  Our project
      http://radiomaranon.org.pe  Radio Marañón, Jaén, Perú
                              o      _     _         _
  ------- __o       __o      /\_   _ \\o  (_)\__/o  (_)          -o)
  ----- _`\<,_    _`\<,_    _>(_) (_)/<_    \_| \   _|/' \/       /\\
  ---- (_)/ (_)  (_)/ (_)  (_)        (_)   (_)    (_)'  _\o_    _\_v
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Why use Windows, when you can leave through the door?


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: how to find out who I am
  2003-08-04 19:43 how to find out who I am Andy Spiegl
       [not found] ` <75FEBB10-C6B4-11D7-9809-000393A707CC@eziba.com>
@ 2003-08-04 20:04 ` Fletch
  2003-08-04 23:18   ` Andy Spiegl
  1 sibling, 1 reply; 8+ messages in thread
From: Fletch @ 2003-08-04 20:04 UTC (permalink / raw)
  To: Andy Spiegl; +Cc: ZSH User List

>>>>> "Andy" == Andy Spiegl <zsh.Andy@spiegl.de> writes:

    Andy> My colleague and I frequently ssh into our servers as root.
    Andy> I'd like to find a way to let zsh distinguish between us,
    Andy> but the environment variable SSH_CLIENT doesn't help because
    Andy> both of us log in from workstations with constantly changing
    Andy> IPs.

    Andy> Is there any other way how I can let zsh know who I am?

[...]


Perhaps . . .

ssh root@somehost -t REALME=andy exec zsh


-- 
Fletch                | "If you find my answers frightening,       __`'/|
fletch@phydeaux.org   |  Vincent, you should cease askin'          \ o.O'
770 294-0820 (m)      |  scary questions." -- Jules                =(___)=
                      |                                               U


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: how to find out who I am
  2003-08-04 20:04 ` Fletch
@ 2003-08-04 23:18   ` Andy Spiegl
  2003-08-05  0:19     ` Fletch
  2003-08-08 17:35     ` Bart Schaefer
  0 siblings, 2 replies; 8+ messages in thread
From: Andy Spiegl @ 2003-08-04 23:18 UTC (permalink / raw)
  To: ZSH User List

Hi Fletch,

> ssh root@somehost -t REALME=andy exec zsh
Great.
Does that have any disadvantages (i.e. any differences) from
compared with the "normal" ssh root@somehost ???

Thanks,
 Andy.

-- 
           http://peru.spiegl.de  Our project
      http://radiomaranon.org.pe  Radio Marañón, Jaén, Perú
                              o      _     _         _
  ------- __o       __o      /\_   _ \\o  (_)\__/o  (_)          -o)
  ----- _`\<,_    _`\<,_    _>(_) (_)/<_    \_| \   _|/' \/       /\\
  ---- (_)/ (_)  (_)/ (_)  (_)        (_)   (_)    (_)'  _\o_    _\_v
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 cogito ergo sum, bibo ergo sum, cogito ergo bib, bibo ergo bib?


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: how to find out who I am
  2003-08-04 23:18   ` Andy Spiegl
@ 2003-08-05  0:19     ` Fletch
  2003-08-05  7:06       ` Thomas Köhler
  2003-08-08 17:35     ` Bart Schaefer
  1 sibling, 1 reply; 8+ messages in thread
From: Fletch @ 2003-08-05  0:19 UTC (permalink / raw)
  To: Andy Spiegl; +Cc: ZSH User List

>>>>> "Andy" == Andy Spiegl <zsh.Andy@spiegl.de> writes:

    Andy> Hi Fletch,
    >> ssh root@somehost -t REALME=andy exec zsh
    Andy> Great.  Does that have any disadvantages (i.e. any
    Andy> differences) from compared with the "normal" ssh
    Andy> root@somehost ???

Shouldn't.  The -t makes ssh allocate a pty even though you've given
it a command to run so things that need one (like zsh or vi :) will
have one.  If you want it to be more like a normal login you could do
`exec su - root' instead.

-- 
Fletch                | "If you find my answers frightening,       __`'/|
fletch@phydeaux.org   |  Vincent, you should cease askin'          \ o.O'
770 294-0820 (m)      |  scary questions." -- Jules                =(___)=
                      |                                               U


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: how to find out who I am
  2003-08-05  0:19     ` Fletch
@ 2003-08-05  7:06       ` Thomas Köhler
  0 siblings, 0 replies; 8+ messages in thread
From: Thomas Köhler @ 2003-08-05  7:06 UTC (permalink / raw)
  To: ZSH User List

[-- Attachment #1: Type: text/plain, Size: 1036 bytes --]

Fletch wrote [2003/08/05]:
> >>>>> "Andy" == Andy Spiegl <zsh.Andy@spiegl.de> writes:
> 
>     Andy> Hi Fletch,
>     >> ssh root@somehost -t REALME=andy exec zsh
                              ^^^^^^^^^^^
>     Andy> Great.  Does that have any disadvantages (i.e. any
>     Andy> differences) from compared with the "normal" ssh
>     Andy> root@somehost ???
> 
> Shouldn't.  The -t makes ssh allocate a pty even though you've given
> it a command to run so things that need one (like zsh or vi :) will
> have one.  If you want it to be more like a normal login you could do
> `exec su - root' instead.
           ^
           wiping out the "REALME" variable? I don't think that's
           what is intended :)

Ciao,
Thomas

-- 
 Thomas Köhler Email:   jean-luc@picard.franken.de     | LCARS - Linux
     <><        WWW:     http://jeanluc-picard.de      | for Computers
                IRC:             jeanluc               | on All Real
               PGP public key available from Homepage! | Starships

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: how to find out who I am
  2003-08-04 23:18   ` Andy Spiegl
  2003-08-05  0:19     ` Fletch
@ 2003-08-08 17:35     ` Bart Schaefer
  2003-08-08 19:37       ` Andy Spiegl
  1 sibling, 1 reply; 8+ messages in thread
From: Bart Schaefer @ 2003-08-08 17:35 UTC (permalink / raw)
  To: ZSH User List

On Aug 4,  9:43pm, Andy Spiegl wrote:
}
} I'd like to find a way to let zsh distinguish between us, but
} the environment variable SSH_CLIENT doesn't help because both of us
} log in from workstations with constantly changing IPs.

On Aug 5,  1:18am, Andy Spiegl wrote:
}
} > ssh root@somehost -t REALME=andy exec zsh
} Great.
} Does that have any disadvantages (i.e. any differences) from
} compared with the "normal" ssh root@somehost ???

You might prefer

	ssh root@somehost -t REALME=andy exec zsh -l

to run zsh as a login shell.

Another trick that I've used in the past is to modify the TERM variable,
which is automatically passed across rsh, rlogin and ssh connections,
and then set it back again in the shell startup files.  For example, on
the local machine

	alias ssh='TERM=$LOGNAME/$TERM ssh'

and in .zshrc (or even .zshenv) on the remote machine

	if [[ $TERM = */* ]]; then
	    RPS1=$TERM:h	# For example
	    TERM=$TERM:t
	fi

This has the advantage of being completely transparent to non-interactive
shells (which don't care about $TERM), and it is propagated automatically
in the event you need to do something like

	ssh -t user@firstremote ssh other@secondremote

(which I have sometimes had to do in order to ssh through firewalls).


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: how to find out who I am
  2003-08-08 17:35     ` Bart Schaefer
@ 2003-08-08 19:37       ` Andy Spiegl
  0 siblings, 0 replies; 8+ messages in thread
From: Andy Spiegl @ 2003-08-08 19:37 UTC (permalink / raw)
  To: ZSH User List

Bart Schaefer wrote:

> You might prefer
> 	ssh root@somehost -t REALME=andy exec zsh -l
> to run zsh as a login shell.

That's what I did anyway. :-)
I'm really happy with that solution and so far I haven't noticed any
negative sideeffects.

> Another trick that I've used in the past is to modify the TERM variable,
> which is automatically passed across rsh, rlogin and ssh connections,
> and then set it back again in the shell startup files.
Great idea, too!
Just have to ignore the first line with the warning:
 zsh: can't find terminal definition for spiegl/xterm

> and it is propagated automatically
> in the event you need to do something like
> 
> 	ssh -t user@firstremote ssh other@secondremote
Very nice.  Thanks for the tipp!
 Andy.

-- 
           http://peru.spiegl.de  Our project
      http://radiomaranon.org.pe  Radio Marañón, Jaén, Perú
                              o      _     _         _
  ------- __o       __o      /\_   _ \\o  (_)\__/o  (_)          -o)
  ----- _`\<,_    _`\<,_    _>(_) (_)/<_    \_| \   _|/' \/       /\\
  ---- (_)/ (_)  (_)/ (_)  (_)        (_)   (_)    (_)'  _\o_    _\_v
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 cogito ergo sum, bibo ergo sum, cogito ergo bib, bibo ergo bib?


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2003-08-08 19:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-04 19:43 how to find out who I am Andy Spiegl
     [not found] ` <75FEBB10-C6B4-11D7-9809-000393A707CC@eziba.com>
2003-08-04 19:58   ` Andy Spiegl
2003-08-04 20:04 ` Fletch
2003-08-04 23:18   ` Andy Spiegl
2003-08-05  0:19     ` Fletch
2003-08-05  7:06       ` Thomas Köhler
2003-08-08 17:35     ` Bart Schaefer
2003-08-08 19:37       ` Andy Spiegl

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).