RE: Environment Settings



I am using normal Unix shell (ksh).

I use ssh to submit application job. And I hope the ssh command can keep
as simple as to have no 'presetting command' such like execute the
dotfiles. In other words, I hope to see the 'environment variables' if I
type the following command line:

ssh host1 set

Above command assumes that I am accepted by host1 through key
authentication. As I tried, the above command does not read the dotfiles
...

Jialing Liang
jialing.liang@xxxxxxx

-----Original Message-----
From: listbounce@xxxxxxxxxxxxxxxxx [mailto:listbounce@xxxxxxxxxxxxxxxxx]
On Behalf Of Greg Wooledge
Sent: Monday, July 09, 2007 6:03 AM
To: Jialing Liang
Cc: secureshell@xxxxxxxxxxxxxxxxx
Subject: Re: Environment Settings

On Thu, Jul 05, 2007 at 01:27:25PM -0600, Jialing Liang wrote:
ssh user can have an 'environment' file under $HOME/.ssh on ssh
server.
That is good enough. However, in case that the $HOME is a shared
directory among several ssh servers, how to make different
environment
settings for each of these servers?

You could run various commands from the user's shell-specific dotfiles
(e.g. ~/.bash_profile or >~/.login). For example, in bash syntax:

case $(uname -n) in
host1) export FOO=bar1;;
host2) export FOO=bar2;;
...
esac

A lot depends on what you're doing with ssh. If you're not using a
traditional Unix shell, then I don't have an answer for you.



Relevant Pages

  • Re: Really need help on this one
    ... Is there a way to read the output of a particular command into ... Heres a better example using ssh. ... set timeout $timeout ... exec kill -9 $pid ...
    (comp.lang.tcl)
  • Re: OT: Hard disk mirror with Paragon on USB stick?
    ... at least two pages of intricate command line stuff. ... The password is only used when you want to backup to a remote machine ... via the network, using the ssh protocol. ... (e.g. with linux, ...
    (sci.electronics.design)
  • RE: midnight commander and ssh sftp
    ... midnight commander and ssh sftp ... which is displayed at the bottom of the MC panel. ... "Left file command options right" at the top of the MC ... MC SSH session with the remote host by hitting F10 key. ...
    (freebsd-questions)
  • Re: sshd and ftpd
    ... ssh keys, so when you log in it doesn't ask for one. ... we want to be able to connect to our remote host without ... If you used the defaults supplied by the ssh-keygen command, ...
    (Ubuntu)
  • Re: [Info-ingres] problems with ssh
    ... Check the SSHD log on the server for errors. ... ancient version of SSH, unfortunately. ... the command seems to have functioned - but just wont terminate and leaves a process hanging around. ... Duckman: You got anymore of those glues? ...
    (comp.databases.ingres)