3

I have opened a ssh session to remote computer using

ssh root@<ip>

I tried to run some program on remote machine. e.g.

tail -f /var/log/log.txt

But when i press ctrl-c or ctrl-z that program is not killed/suspended. I couldn't able to get control out of that process in terminal.

akshay
  • 131
  • 3
  • @Bungicasse tried that now, still not able to kill – akshay Jan 07 '17 at 14:39
  • Does the `tail -f` continue to output data? It may be that the terminal session crashes (either some sort of remote timeout or pipe issue) – stuts Jan 09 '17 at 14:20
  • @stuts yes tail is still running. If i login to another session and kill tail, i can access the terminal – akshay Jan 09 '17 at 14:31
  • What OS are the source and destination systems? Does this problem effect all user accounts? I'm wondering if there could be a custom terminal/shell profile or something that overrides shortcuts on the destination system. – stuts Jan 09 '17 at 14:34
  • @stuts source is redhat linux and destination is QNX PPC. telnet session is working properly – akshay Jan 09 '17 at 14:42
  • What kind of system is the QNX PPC? Does it work when you try Ctrl-Break (the Pause/Break key)? Do the suspension/resume keys work (Ctrl-S & Ctrl-Q)? Do you have the latest version of the OS installed (may be a bug in a package)? Has the handler for ctrl-c been changed ([see this forum post](http://www.openqnx.com/phpbbforum/viewtopic.php?t=3287))? – stuts Jan 09 '17 at 15:08
  • I am sure there is no change in signal handler, otherwise Ctrl-c in telnet session wouldn't have worked. also instead of `tail` this time i tried `cat>newfile with Ctrl-c in ssh session`, it is not working but working as expected in telnet session. @stuts – akshay Jan 09 '17 at 15:48
  • Do you provide any arguments to your ssh command? Could you try `-t` argument to `ssh` as this should forward the raw ctrl-c to the server. – stuts Jan 09 '17 at 15:54
  • @stuts `ssh -t` is also not working. One more thing i noticed is in terminal(ksh) if I press ctrl-c cursor moves and Ctrl-D close the session but in foreground process it is not taking the Ctrl-c or Ctrl-d – akshay Jan 09 '17 at 16:13
  • Is that on the client or the server? Do you see `^C` print to the terminal? – stuts Jan 09 '17 at 16:20
  • I encounter the same issue. Now I have to using the following commands to terminate the tail process `ctrl - z` then `kill %1` – Ryan Lyu Dec 18 '19 at 10:32

0 Answers0