executing command in a remote machine through ssh - shell script

Hi All,

i have two machines like x and y . my requirement is i should connect to machine Y from x through ssh connection . and do some operation such as copy and move and delete files in Y machine .

i tried with this code but it is doing in machine x only . and i need to exit from Y when all is done .

ssh -l username x `mkdir /tmp/created ; mkdir two ; `

When you are on x and want to do it on y, you have to write as hostname y, not x. Also using single backticks like ` is not ok - those have a complete different effect than using single quotes ' or double quotes ".

ssh -l username y "mkdir /tmp/created ; mkdir two"

Correct this and try again.