For some actions, I need to ssh with ssh -X user@host
. Is it possible for Ruby's Net::SSH to use this (with emphasis on the -X
)?
Net::SSH.start('host', 'user', password: 'password') do |ssh|
# Do work
end
I'm not currently seeing any options to enable X11 Forwarding. Are there any options for this?
Update
More information found in the SSH Manual
-X Enables X11 forwarding. This can also be specified on a per-host basis in a configuration file.
X11 forwarding should be enabled with caution. Users with the ability to bypass file permissions on the remote host (for the user's X authorization database) can access the local X11 display through the forwarded connection. An attacker may then be able to perform activities such as keystroke monitoring.
For this reason, X11 forwarding is subjected to X11 SECURITY extension restrictions by default. Please refer to the
ssh -Y
option and theForwardX11Trusted
directive in ssh_config(5) for more information.
Background
Essentially I am automating a process. Users right now ssh into a server and run some commands with the -X
option. I'm told that the -X
option is a requirement. I've successfully used Net::SSH
to do the commands, but I'm still told they need the -X
option to present.