Possible Duplicate:Using an already established SSH channel Here is my sync script:ssh user@remote.host /etc/init.d/some_service stopscp user@remote.host:/var/some_service/events ./eventsscp ./new_data user@remote.host:/var/some_service/new_datassh user@remote.host /etc/init.d/some_service startAs You can see, it stops service, perform some copies with scp and starts service back.The problem: it costs 4 similar ssh connections in a row.Is there any way to make all the work, using one physical ssh connection?
Copy over ssh and execute commands in one session
ssh;scp