Executing ruby command is not working from windows to mac connected by putty

Hi All,

I want to delete some files from Mac system where I am in the windows
sytem.

System1 ( win7) logged in with userid :- arihan.sinha

system2( Mac system 172.20.10.65 name:- developers-iMac.local) loggedin
with userid :- developer

I am using putty to connect system1 to system2 where priviate key is in
my window system1 and public key in mac system2.

puts %x[c:\Program Files (x86)\PuTTY\plink -i
“C:\Users\arihan.sinha\.ssh\authorized_key.ppk”
[email protected] “pwd”]

%x[c:\Program Files (x86)\PuTTY\plink -i
“C:\Users\arihan.sinha\.ssh\authorized_key.ppk”
[email protected] “cd Library”]

puts %x[c:\Program Files (x86)\PuTTY\plink -i
“C:\Users\arihan.sinha\.ssh\authorized_key.ppk”
[email protected] “pwd”]

%x[c:\Program Files (x86)\PuTTY\plink -i
“C:\Users\arihan.sinha\.ssh\authorized_key.ppk”
[email protected] “cd
Library/Caches/Google/Chrome/Default/Cache”]

puts %x[c:\Program Files (x86)\PuTTY\plink -i
“C:\Users\arihan.sinha\.ssh\authorized_key.ppk”
[email protected] “pwd”]

all cases its giving output as
/Users/developer
/Users/developer
/Users/developer

Can anyone please guide me If I am doing any mistakes.

Cheers
A

On 10/28/2010 06:33 AM, Arihan S. wrote:

I am using putty to connect system1 to system2 where priviate key is in
puts %x[c:\Program Files (x86)\PuTTY\plink -i
[email protected] “pwd”]

all cases its giving output as
/Users/developer
/Users/developer
/Users/developer

Can anyone please guide me If I am doing any mistakes.

This all seems to be working very well, so you have proven that you can
use SSH to log into the Mac system. If you want to run your Ruby script
on the Mac, you will need to have the script on the Mac as well as an
installation of Ruby.

This method of accessing the Mac via SSH only lets you run remote
commands directly on the Mac. You cannot run a command on your Windows
system and have it do something directly with the Mac’s filesystem.

If you want to try to access the Mac’s filesystem directly by using a
script running on the Windows machine, you should be able to do so using
SFTP. Look up the Net::SFTP module for Ruby.

-Jeremy

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs