different remote environment variables with putty and plink - SSH

This is a discussion on different remote environment variables with putty and plink - SSH ; If I connect to a server using a saved session and putty and then run "echo $PATH", I get the expected list of paths, but if I connect using the same saved session and plink and send the same command, ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: different remote environment variables with putty and plink

  1. different remote environment variables with putty and plink

    If I connect to a server using a saved session and putty and then run
    "echo $PATH", I get the expected list of paths, but if I connect using
    the same saved session and plink and send the same command, I get a
    very short list of paths. PATH is not the only environment variable
    that is different; many are missing and most have different values in
    the plink connection. I haven't found any comments to give me an idea
    about why the environment is different when I connect with plink. Is
    it due to putty/plink or a setting on the server?

    Matt


  2. Re: different remote environment variables with putty and plink

    >>>>> "MTM" == mtmcclellan writes:

    MTM> If I connect to a server using a saved session and putty and then
    MTM> run "echo $PATH", I get the expected list of paths, but if I
    MTM> connect using the same saved session and plink and send the same
    MTM> command, I get a very short list of paths. PATH is not the only
    MTM> environment variable that is different; many are missing and most
    MTM> have different values in the plink connection. I haven't found
    MTM> any comments to give me an idea about why the environment is
    MTM> different when I connect with plink. Is it due to putty/plink or
    MTM> a setting on the server?

    In the first case, the shell is invoked as a "login" shell; in the second,
    it isn't. Shells behave differently this way, particularly in regard to
    what startup files they read. If you're using bash, see the INVOCATION
    section of the man page.

    --
    Richard Silverman
    res@qoxp.net


  3. Re: different remote environment variables with putty and plink

    On Jun 6, 11:23 pm, "Richard E. Silverman" wrote:
    > >>>>> "MTM" == mtmcclellan writes:

    >
    > MTM> If I connect to a server using a saved session and putty and then
    > MTM> run "echo $PATH", I get the expected list of paths, but if I
    > MTM> connect using the same saved session and plink and send the same
    > MTM> command, I get a very short list of paths. PATH is not the only
    > MTM> environment variable that is different; many are missing and most
    > MTM> have different values in the plink connection. I haven't found
    > MTM> any comments to give me an idea about why the environment is
    > MTM> different when I connect with plink. Is it due to putty/plink or
    > MTM> a setting on the server?
    >
    > In the first case, the shell is invoked as a "login" shell; in the second,
    > it isn't. Shells behave differently this way, particularly in regard to
    > what startup files they read. If you're using bash, see the INVOCATION
    > section of the man page.
    >
    > --
    > Richard Silverman
    > r...@qoxp.net


    Thank you, that definitely helped. I've posted another message on
    this group as well as a couple others. I'm still not sure how to
    resolve the problem or if part of the issue is related to using ssh
    key authentication, but as you said, it must involve the invocation
    type and startup files.


+ Reply to Thread