Re: Login, su to root, execute command - WeOnlyDo Discussion board

Re: Login, su to root, execute command (General questions)

by shin, Tuesday, June 24, 2008, 03:54 (5787 days ago) @ woddrazen

Shin,


Please try this:
[code]<

set ssh = CreateObject( WeOnlyDo.wodSSHCom.1 )
ssh.Login = name
ssh.Password = pwd
ssh.Hostname = ip
ssh.Blocking = 1
ssh.Protocol = 1
ssh.Port = 23
ssh.Timeout = 30
ssh.Connect

ssh.WaitFor regex:[$ #>] $ ,30
ssh.Send rsh server2 & vbLf
ssh.DataReady = 0
ssh.WaitFor regex:[$ #>] $ ,30
a = ssh.Execute( ls & vbLf, regex:[$ #>] $ ,30)
ssh.Disconnect

response.write a

>[/code]
Drazen

Thanks a lot, Drazen !
This code works normally & stably.
But why the original code can't work ?
What's the different between execute and send ?


Complete thread: