Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using multiple terminals on a remote machine using a single SSH connection

Tags:

ssh

tcp

sockets

I'm running a process on a remote server through SSH on a certain port. The process is basically a TCP server waiting (listening) for a connection. So as long as it is running I cannot use the terminal as it is a blocking application.

I want to run another application (a TCP client) through the same instance of SSH connection to connect to that TCP server. I used screen to detach the first process (TCP Server) and connect to the server but then I could not see the output of the TCP server application.

Is there a way to emulate two terminals on a remote machine using SSH?

like image 350
qutab Avatar asked Apr 20 '26 03:04

qutab


1 Answers

So I found a solution to this problem. Basically below is a link that explains how can I achieve exactly what I needed. That is, opening multiple terminals using a single SSH connection.

http://idnotfound.wordpress.com/2008/01/14/multiple-terminals-in-a-single-ssh-session/

In short we can use the following procedure:

$ ssh -X mylogin@remotemachine gnome-terminal Password: ... [Ctrl+Z] $ bg $ exit

Press Ctrl+Shift+N to open a new terminal.

EDIT: Or just use screen. Sigh..

like image 139
qutab Avatar answered Apr 22 '26 10:04

qutab



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!