Method: Net::SSH::Connection::Channel#env

Defined in:
lib/net/ssh/connection/channel.rb

#env(variable_name, variable_value, &block) ⇒ Object

Syntactic sugar for setting an environment variable in the remote process’ environment. Note that for security reasons, the server may refuse to set certain environment variables, or all, at the server’s discretion. If you are connecting to an OpenSSH server, you will need to update the AcceptEnv setting in the sshd_config to include the environment variables you want to send.

channel.env "PATH", "/usr/local/bin"


187
188
189
# File 'lib/net/ssh/connection/channel.rb', line 187

def env(variable_name, variable_value, &block)
  send_channel_request("env", :string, variable_name, :string, variable_value, &block)
end