Mombu the GNU Linux Forum sponsored links

Go Back   Mombu the GNU Linux Forum > GNU_Linux > ssh forwarding environment variables
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 31st May 23:09
nori heikkinen
External User
 
Posts: 1
Default ssh forwarding environment variables



[this came up in a different thread, but since the question has taken
on a whole new bent, i thought i'd re-thread it]

i'd like to forward a customized environment variable from machine A
to machine B, when i connect via ssh. reading the ssh manpage, it
seems that i should be able to create '~/.ssh/environment' containing
'MYVARIABLE=foo' on machine A, and then, upon ssh'ing to machine B,
'echo $MYVARIABLE' should print out 'foo'.

but it doesn't. am i missing something? i can't see anything
relevant on the sshd manpage, so i don't think i need to do anything
to the sshd config on machine B.

help?

tia,

</nori>

--
.~. nori @ sccs.swarthmore.edu
/V\ http://www.sccs.swarthmore.edu/~nori/jnl/
// \\ @ maenad.net
/( )\ http://www.maenad.net
^`~'^
*------------------------------------------------------------------------*
* http://www.aidsmarathon.com/participant.asp?runner=DCNO-3267&year=2003 *
*------------------------------------------------------------------------*
* Please help me raise money for AIDS as I train for *
* the Whitman-Walker AIDS Marathon! *
*------------------------------------------------------------------------*

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE/zjvK9hhw1X7eVJkRAmA0AJ9fj7nCeF+XaqrcYrBAHdwU1eNznw CfQW4n
3QuST3+4qhRMq5Poer6jDlA=
=asYl
-----END PGP SIGNATURE-----
  Reply With Quote


  sponsored links


2 31st May 23:09
vineet kumar
External User
 
Posts: 1
Default ssh forwarding environment variables



* Nori Heikkinen (nori@sccs.swarthmore.edu) [031203 13:28]:


PermitUserEnvironment
Specifies whether ~/.ssh/environment and environment= options in
~/.ssh/authorized_keys are processed by sshd. The default is
“no”. Enabling environment processing may enable users to bypass
access restrictions in some configurations using mechanisms such
as LD_PRELOAD.

-- sshd_config(5)

good times,
Vineet
--
http://www.doorstop.net/
--
"Those who desire to give up freedom in order to gain security will not
have, nor do they deserve, either one." --President Thomas Jefferson

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/zldh7z3S33fUb9ERAleKAKDIX6s1MALqM5axiExOQp1Llr1Qxg Cg9LIK
ulv4SSeEoADE4qa6ZU88pa4=
=7bFd
-----END PGP SIGNATURE-----
  Reply With Quote


  sponsored links


3 31st May 23:09
nori heikkinen
External User
 
Posts: 1
Default ssh forwarding environment variables


on Wed, 03 Dec 2003 01:36:33PM -0800, Vineet Kumar insinuated:


hm, not in mine ... but i tried it anyhow, and got:

orange:~# /etc/init.d/ssh restart
/etc/ssh/sshd_config: line 72: Bad configuration option: PermitUserEnvironment
/etc/ssh/sshd_config: terminating, 1 bad configuration options

there appears to be nothing like that in my sshd_config manpage. i'm
running ssh v3.4p1-4.

thanks again,

</nori>

--
.~. nori @ sccs.swarthmore.edu
/V\ http://www.sccs.swarthmore.edu/~nori/jnl/
// \\ @ maenad.net
/( )\ http://www.maenad.net
^`~'^
*------------------------------------------------------------------------*
* http://www.aidsmarathon.com/participant.asp?runner=DCNO-3267&year=2003 *
*------------------------------------------------------------------------*
* Please help me raise money for AIDS as I train for *
* the Whitman-Walker AIDS Marathon! *
*------------------------------------------------------------------------*

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE/zlu59hhw1X7eVJkRAsshAJ9kjZF89zVZ706Auvylji9M2FG/qwCeM2Um
MmNs1nFf92gs1+FMXmcwOcQ=
=/PXt
-----END PGP SIGNATURE-----
  Reply With Quote
4 31st May 23:10
nori heikkinen
External User
 
Posts: 1
Default ssh forwarding environment variables


[this came up in a different thread, but since the question has taken
on a whole new bent, i thought i'd re-thread it]

i'd like to forward a customized environment variable from machine A
to machine B, when i connect via ssh. reading the ssh manpage, it
seems that i should be able to create '~/.ssh/environment' containing
'MYVARIABLE=foo' on machine A, and then, upon ssh'ing to machine B,
'echo $MYVARIABLE' should print out 'foo'.

but it doesn't. am i missing something? i can't see anything
relevant on the sshd manpage, so i don't think i need to do anything
to the sshd config on machine B.

help?

tia,

</nori>

--
.~. nori @ sccs.swarthmore.edu
/V\ http://www.sccs.swarthmore.edu/~nori/jnl/
// \\ @ maenad.net
/( )\ http://www.maenad.net
^`~'^
*------------------------------------------------------------------------*
* http://www.aidsmarathon.com/participant.asp?runner=DCNO-3267&year=2003 *
*------------------------------------------------------------------------*
* Please help me raise money for AIDS as I train for *
* the Whitman-Walker AIDS Marathon! *
*------------------------------------------------------------------------*

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE/zjvK9hhw1X7eVJkRAmA0AJ9fj7nCeF+XaqrcYrBAHdwU1eNznw CfQW4n
3QuST3+4qhRMq5Poer6jDlA=
=asYl
-----END PGP SIGNATURE-----
  Reply With Quote
5 31st May 23:10
vineet kumar
External User
 
Posts: 1
Default ssh forwarding environment variables


* Nori Heikkinen (nori@sccs.swarthmore.edu) [031203 13:28]:


PermitUserEnvironment
Specifies whether ~/.ssh/environment and environment= options in
~/.ssh/authorized_keys are processed by sshd. The default is
“no”. Enabling environment processing may enable users to bypass
access restrictions in some configurations using mechanisms such
as LD_PRELOAD.

-- sshd_config(5)

good times,
Vineet
--
http://www.doorstop.net/
--
"Those who desire to give up freedom in order to gain security will not
have, nor do they deserve, either one." --President Thomas Jefferson

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/zldh7z3S33fUb9ERAleKAKDIX6s1MALqM5axiExOQp1Llr1Qxg Cg9LIK
ulv4SSeEoADE4qa6ZU88pa4=
=7bFd
-----END PGP SIGNATURE-----
  Reply With Quote
6 31st May 23:10
nori heikkinen
External User
 
Posts: 1
Default ssh forwarding environment variables


on Wed, 03 Dec 2003 01:36:33PM -0800, Vineet Kumar insinuated:


hm, not in mine ... but i tried it anyhow, and got:

orange:~# /etc/init.d/ssh restart
/etc/ssh/sshd_config: line 72: Bad configuration option: PermitUserEnvironment
/etc/ssh/sshd_config: terminating, 1 bad configuration options

there appears to be nothing like that in my sshd_config manpage. i'm
running ssh v3.4p1-4.

thanks again,

</nori>

--
.~. nori @ sccs.swarthmore.edu
/V\ http://www.sccs.swarthmore.edu/~nori/jnl/
// \\ @ maenad.net
/( )\ http://www.maenad.net
^`~'^
*------------------------------------------------------------------------*
* http://www.aidsmarathon.com/participant.asp?runner=DCNO-3267&year=2003 *
*------------------------------------------------------------------------*
* Please help me raise money for AIDS as I train for *
* the Whitman-Walker AIDS Marathon! *
*------------------------------------------------------------------------*

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE/zlu59hhw1X7eVJkRAsshAJ9kjZF89zVZ706Auvylji9M2FG/qwCeM2Um
MmNs1nFf92gs1+FMXmcwOcQ=
=/PXt
-----END PGP SIGNATURE-----
  Reply With Quote
7 1st June 08:58
vineet kumar
External User
 
Posts: 1
Default ssh forwarding environment variables


* Nori Heikkinen (nori@sccs.swarthmore.edu) [031203 13:56]:


Sorry, my bad. 3.6.1 here.

Anyway, I think your understanding of ~/.ssh/environment is incorrect
(though I may be wrong; I've never used this particular feature).

I belive that ~/.ssh/environment is read by sshd on the server. Does it
work if you have MYVAR=foo in ~/.ssh/environment on the remote system?
I don't think the local file ~/.ssh/environment matters at all. I can
see how the manpage (at least in this version) infers that the contents
of the local environment file are inserted into the environment in the
remote session, but I don't think that's how it really works. The sshd
manpage spells it out in the way I would have guessed it would work. If
I'm right about this (I haven't tested it at all) a bug should be filed
against ssh for the poor explanation of environment in the ssh(1)
manpage.

good times,
Vineet
--
http://www.doorstop.net/
--
One nation, indivisible, with equality, liberty, and justice for all.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/zl5H7z3S33fUb9ERAhjCAKCpEwvjT7SIPTlQe6nofa0Zv8oTlA CgiX+d
MOmpwQbzq9POoP3ehAyyChU=
=d+e0
-----END PGP SIGNATURE-----
  Reply With Quote
8 1st June 08:59
nori heikkinen
External User
 
Posts: 1
Default ssh forwarding environment variables


on Wed, 03 Dec 2003 02:05:59PM -0800, Vineet Kumar insinuated:

so, do i need to upgrade to get this functionality? because there's
no mention of it in the sshd_config manpage ...

is it in unstable? (i'm not positive how to use apt-cache to show
which debian version a given version of a package is in ... i've
always used packages.debian.org for that.)


the remote system being machine B, the one running sshd, the one into
which i'm tryng to ssh, the one on which i want the variable set?

oh, you're right ... so i see. what good is that, then? that means
the remote (machine B) ~/.ssh/environment file can set a variable for
every ssh connection into it ... i don't see the utility of that.


i think it explained it decently -- i just willfully misinterpreted it
to make it mean what i wanted it to

is it possible to do what i want, then -- which is to export a
variable by ssh from machine A into machine B's environment? maybe by
some other method?

thanks,

</nori>

--
.~. nori @ sccs.swarthmore.edu
/V\ http://www.sccs.swarthmore.edu/~nori/jnl/
// \\ @ maenad.net
/( )\ http://www.maenad.net
^`~'^
*------------------------------------------------------------------------*
* http://www.aidsmarathon.com/participant.asp?runner=DCNO-3267&year=2003 *
*------------------------------------------------------------------------*
* Please help me raise money for AIDS as I train for *
* the Whitman-Walker AIDS Marathon! *
*------------------------------------------------------------------------*

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE/zmV49hhw1X7eVJkRAqoTAJ9yZTSJ2FmvIIUcSaEYG2tZ4/MCaQCfVsvB
T/ZOa+4l5PFJTrRu0nYCW98=
=4x24
-----END PGP SIGNATURE-----
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666