From: Jorge Almeida <jalmeida@math.ist.utl.pt>
To: gentoo-user@lists.gentoo.org
Subject: [gentoo-user] [OT] Passing env variable to ssh?
Date: Mon, 13 Mar 2006 20:14:33 +0000 (WET) [thread overview]
Message-ID: <Pine.LNX.4.64.0603131957520.29486@jmaa.math.ist.utl.pt> (raw)
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
next reply other threads:[~2006-03-13 20:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-13 20:14 Jorge Almeida [this message]
2006-03-13 20:36 ` [gentoo-user] [OT] Passing env variable to ssh? 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.64.0603131957520.29486@jmaa.math.ist.utl.pt \
--to=jalmeida@math.ist.utl.pt \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox