ssh

ssh ( string server , string login , string password , string command , int _port , boolean[default:false] _x11 , boolean[default:true] _waitReturn , int[default:300] _maxDelayWaitReturn ) : string

Send a command by SSH. Returns the result printed in the SSH shell.

Example

console( sshCommand(connection, "cd / && ls") )

Parameters

server

host

login

password

command

Command to send in SSH. Note: all command are sent on its own shell, so if you need to send sevral command or use a special workspace use && to separate commands (or ;). Ex: "cd /usr/ && ls".

_port (optional)

default:22

_x11 (optional)

Do you need to use X11 fowarding (to execute the command in the graphical interface).

_waitReturn (optional)

If true, it returns the text displayed by the ssh command. Else, it just send the command.

_maxDelayWaitReturn (optional)

Some servers may not return an end-of-return signal and this function may run undefined. To avoid this behavior, you can specify here a maximum waiting time in seconds (by default 5 minutes). If no return is sent during this time the function returns the accumulated output.