Re: How to make sshd inherit environment variable from its parent process?

Chansup Byun <Chansup.Byun@xxxxxxx> writes:

Suppose you have hunders of jobs of a particular user and their job
types are different from one to another, how do you set "ENVIRONMENT"
for each job using ~/.ssh/envionment because there are multiple jobs
can be scheduled at the same time?

I may have missed something here but this approach doesn't look
practical for me.

You are correct.

I'm looking for a way that the sshd process can inherit EVs from its
parent process as shown below. Is there a way to do that?

I don't believe there is an easy way. (But I'd be glad to be proved wrong.)

I usually do something like replacing

ssh remotehost remotecmd


ssh remotehost "sh -c 'ENVVAR=$ENVVAR remotecmd'"

Leif Nixon - Systems expert
National Supercomputer Centre - Linkoping University