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



ilaiy wrote:

You can enable PermitUserEnvironment in your sshd_config

You should be able to add the variable called as "ENVIRONMENT" to your
list and have it do the corresponding thing ..




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.

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?

26848 sge_shepherd-412 -bg
26849 /usr/local/sbin/sshd -i 26852 /usr/local/sbin/sshd -i
26853 /gridware/n1ge6u6/utilbin/sol-sparc64/qrsh_starter ...

Thanks,

- Chansup


./thanks
ilaiy

On 1/31/06, Chansup Byun <Chansup.Byun@xxxxxxx> wrote:


ilaiy wrote:


You could set all the variables you want in

~/.ssh/environment



That's not acceptible for this case because I want to control user's
resources based on user's job types, which is determined by a dynamic
environment variable called "ENVIRONMENT" when jobs were submitted to
the job scheduler [grid engine].

I couldn't find any other way to set this variable without intervening
user's own environment so far.

Thanks,

- Chnasup



./thanks
ilaiy
On 1/30/06, Chansup Byun <Chansup.Byun@xxxxxxx> wrote:



Hi,

I am using OpenSSH 4.2p1.

I need to make sshd process to inherit some environment variables (EVs)


from its parent process.


It looks like sshd process only inherits a limited number of EVs: HOME,
LOGNAME, MAIL, PATH,PWD,SHELL,SSH_CLIENT,SSH_CONNECTION,TZ, and USER.

Is it possible to make the child sshd process inherit some EVs from its
parent process? Those EVs are dynamically set after submitting a job.

Please let me know how to do it if it's possible.

26768 /gridware/n1ge6u6/bin/sol-sparc64/sge_execd
26769 sge_shepherd-412 -bg
26785 -ksh /gridware/n1ge6u6/default/spool/hes-hpc4/job_scripts/412
26847 /gridware/n1ge6u6/bin/sol-sparc64/qrsh -nostdin -inherit
hes-hpc4 sleep 120; ec
26850 /usr/local/bin/ssh -x -n -p 59527 hes-hpc4 exec
'/gridware/n1ge6u6/utilbin/sol-
26848 sge_shepherd-412 -bg
26849 /usr/local/sbin/sshd -i <<< Why the sshd process inherits
only some EVs from its parent process?
26852 /usr/local/sbin/sshd -i
26853 /gridware/n1ge6u6/utilbin/sol-sparc64/qrsh_starter
/gridware/n1ge6u6/default/sp
26854 ksh -c sleep 120; echo BATCH;ulimit -t
26855 sleep 120

The parent sge_shepherd process sets some environment variables
dynamically. Onne of them is called "ENVIRONMENT".
Using the ENVIRONMENT variable attribute [ either interactive or batch],
users' computational resources can be set differently.

Since sshd didn't inherit the ENVIRONMENT variable, the variable didn't
get passed to its child process, qrsh_starter as shown above. So
resources doesn't get set properly.

Thanks,

- Chansup












Relevant Pages

  • Re: RE: How to manipulate environment variables in parent process?
    ... I make the child manipulate the environment table in the parent? ... If you can get the parent process to cooperate, though, it is able to ... your Perl program, then use that output to set environment variables, ...
    (perl.beginners)
  • Re: How to make sshd inherit environment variable from its parent process?
    ... You should be able to add the variable called as "ENVIRONMENT" to your ... >>>I need to make sshd process to inherit some environment variables ... >>>from its parent process. ... >>>It looks like sshd process only inherits a limited number of EVs: ...
    (SSH)
  • Confusion on DosStartSession and environment
    ... I am trying to start a child process with some environment, ... additional variables set ) in the parent process. ...
    (comp.os.os2.programmer.misc)
  • Re: Confusion on DosStartSession and environment
    ... the environment of the parent process and some that I have set additional variables set ) in the parent process. ... But if I print out the same information in the child, it only contains the very first entry, i.e. ...
    (comp.os.os2.programmer.misc)
  • Environment Variables Re-Visited
    ... Ken and Tony responded correctly to my previous enquiry re Environment ... But I really did not pose the question that I meant to.I simply asked if it ... on exit from the parent process the created ... Environment Variable was wiped from the Table of Environment Variables. ...
    (microsoft.public.vb.enterprise)