Skip to content

Instantly share code, notes, and snippets.

@Spechal
Created May 16, 2012 17:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Spechal/d404d9c9469ff45b5143 to your computer and use it in GitHub Desktop.
Save Spechal/d404d9c9469ff45b5143 to your computer and use it in GitHub Desktop.
Ruby Net::SSH change directory
Net::SSH.start(host, 'root') do |ssh|
puts "Chaging directories to #{VCL_DIR}"
ssh.exec!("cd #{VCL_DIR}")
res = ssh.exec!("pwd")
puts "Server reports current directory as #{res}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment