public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] [OT] Passing env variable to ssh?
@ 2006-03-13 20:14 Jorge Almeida
  2006-03-13 20:36 ` Hans-Werner Hilse
  2006-03-13 21:16 ` Mariusz Pękala
  0 siblings, 2 replies; 5+ messages in thread
From: Jorge Almeida @ 2006-03-13 20:14 UTC (permalink / raw
  To: gentoo-user

Anyone knows a way to pass an environment variable to a openssh command?
I doubt there is a way, but who knows...
I want something like this:
myvar="whatever" ssh myuser@remotebox.org ./bin/mycommand $myvar
This would execute a command with argument "whatever". The problem is that I
want to authenticate via a cryptographic key allowing only this command,
i.e., the file ~/.ssh/authorized_keys of myuser at remotebox has a line
command="~/bin/mycommand $myvar" <public-key>
This does not work, because remotebox doesn't know about $myvar. Of
course, if I could pass a variable to remotebox, the line might be just
command="~/bin/mycommand" <public-key>
and the ssh command would be
myvar="whatever" ssh myuser@remotebox.org ./bin/mycommand
(the program itself would use the value of $myvar)

Any idea?

-- 
Jorge Almeida
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-03-13 22:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-13 20:14 [gentoo-user] [OT] Passing env variable to ssh? Jorge Almeida
2006-03-13 20:36 ` Hans-Werner Hilse
2006-03-13 22:42   ` Jorge Almeida
2006-03-13 21:16 ` Mariusz Pękala
2006-03-13 22:44   ` Jorge Almeida

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox