m***@juno.com
2007-06-07 15:46:05 UTC
I cannot figure out how to get the environment setup correctly for the
connection I'm making with PuTTY's plink application. With putty, I
saved a session from an ssh connection; it includes the username to
connect as and the path to the private key file to use for
authentication. So when I connect interactively with putty, using the
saved session, I don't need to provide a username or password, I'm
automatically connected as the saved user and the expected environment
variables and values exist. The shell is ksh. When I connect with
plink, non-interactively, using the same "saved session", I just need
to run one command (a ksh script). It is still connecting as the
saved user (at least $HOME is the expected value and a plink message
says "Using username abc".) but the enironment is not set as it was
with the putty connection; which means the script fails.
The environment settings that I need are set in the user's .profile
file, so I think the "saved session" might be treated as a login
invocation of ksh, at least through putty. But obviously .profile is
not being sourced when I connect with plink. Any ideas on what
startup files are being sourced when I connect with plink this way?
What files could I create or edit so that the saved username
user's .profile is sourced when I connect with plink? Or do I need to
duplicate (or move) the settings I care about to a more global startup
file?
connection I'm making with PuTTY's plink application. With putty, I
saved a session from an ssh connection; it includes the username to
connect as and the path to the private key file to use for
authentication. So when I connect interactively with putty, using the
saved session, I don't need to provide a username or password, I'm
automatically connected as the saved user and the expected environment
variables and values exist. The shell is ksh. When I connect with
plink, non-interactively, using the same "saved session", I just need
to run one command (a ksh script). It is still connecting as the
saved user (at least $HOME is the expected value and a plink message
says "Using username abc".) but the enironment is not set as it was
with the putty connection; which means the script fails.
The environment settings that I need are set in the user's .profile
file, so I think the "saved session" might be treated as a login
invocation of ksh, at least through putty. But obviously .profile is
not being sourced when I connect with plink. Any ideas on what
startup files are being sourced when I connect with plink this way?
What files could I create or edit so that the saved username
user's .profile is sourced when I connect with plink? Or do I need to
duplicate (or move) the settings I care about to a more global startup
file?