Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require "remote_exec"
- task :default => [:login] do
- # shell = @rsh.shell
- # session = @rsh.session
- out = @rsh.shell.send_command("cd /usr/ubac")
- p out
- out = @rsh.shell.send_command("pwd")
- p out
- out = @rsh.shell.send_command("mkdir baz")
- p out
- @rsh.shell.exit
- @rsh.session.close
- end
- task :login do
- ip = "localhost"
- port = 22
- user = "foobar"
- password = "blameitonjava"
- @rsh = RemoteShell.new
- @rsh.start_ssh_session ip,port,user,password
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement