0

I followed the example from this question to create the heredoc below:

ssh -t -t me@abc.xxx.com <<'ENDSSH'
cd my_dir
myprog arg1 arg2
ENDSSH

This will ssh into the remote machine and launch a program with a couple arguments. The issue is, when I am done using myprog, pressing control+C exits the entire ssh session instead of just quitting myprog.

How can I adjust my heredoc so it acts the same way as if I just typed those commands in manually?

Community
  • 1
  • 1
user1956609
  • 2,132
  • 5
  • 27
  • 43
  • You can't directly. Local signals target local processes. You cannot send a signal to a remote process. You'd have to implement a message broker or bus system or similar for that. But what for? Why is killing the ssh process such an issue if it only saves that single purpose anyway? – arkascha Dec 12 '15 at 20:23
  • or look at running `screen` inside of your remote `ssh` connection. Good luck. – shellter Dec 12 '15 at 22:17

0 Answers0