From: Heesob Park Date: 2008-10-15T11:19:18+09:00 Subject: Re: Using Net SSH to issue command on remote windows XP 2008/10/15 Saritha Yeddula : > Heesob Park wrote: >> Hi, >> >> 2008/10/14 Saritha Yeddula : >>> Thanks >>> Saritha >> >> Try psexec.exe ( download at http://live.sysinternals.com/psexec.exe ) >> >> You can do remote command like this: >> >> psexec \\192.168.0.1 -u administrator -p password cmd.exe /c dir >> >> Regards, >> >> Park Heesob > > Thanks Park ! > > Can Net SSH be used if OPENSSH is installed for windows ? > since I'm using ruby Net SSH for issuing commands on remote linux > machines. > Is there any utility in ruby to issue command on remote windows machine. > What's your problem with Net SSH? 1. Install OpenSSH server 2. Create an user account for SSH 3. In OpenSSH bin folder mkpasswd -l user >> ../etc/passwd 4. Run following code. require 'net/ssh' host = '127.0.0.1' user = 'test' password = 'test' command = 'cmd.exe /c dir' Net::SSH.start( host, user, :password=> password) do |ssh| puts "Opened Connection to #{host}" puts ssh.exec!( "#{command}") puts "Closed Connection to #{host}" end Regards, Park Heesob