FAQ Database Discussion Community


Ruby use local defined variable to a remote server connection

ruby,ssh,net-ssh
Here is what i want to do: VAR_NAME="lala123" Net::SSH.start( HOST, USER ) do |ssh| create_file = ssh.exec!('sudo mkdir /path/to/; \ sudo touch /path/to/file; \ sudo echo #{VAR_NAME} > /path/to/file') end The problem is similar with this one Ruby Net::SSH Change directories using variable interpolation but i didn't find a way...

Stop SSH password prompts in serverspec

ruby,net-ssh,serverspec
I'm in an environment with authentication tokens, so typically a SSH password is not required. My serverspec tests are always asking me for a password. Is there a way to prevent this? No password required: $ ssh atlspf01 [email protected]:~$ Yet, in serverspec $ rake spec Password: Relevant code in spec_helper.rb...