-2

I have two computers running Debian and connected via Ethernet. They see each other. I need to connect two virtual terminals on this computer this way: anything I input in first terminal will be printed in another terminal and vice versa. I read about socat util, but the problem is I probably won't have enough rules to install socat. Are there any other methods which are easier and might not force me to install anything?

  • 1
    do you have netcat? find out with `which -a nc` – Marcel Aug 25 '16 at 08:48
  • If you have a compiler installed, you can download the socat source and compile it, installing it somewhere in your home directory – adamo Aug 25 '16 at 10:08
  • You don't permissions to install additional binaries - so we're supposed to guess what software is available? In addition to adamo's question above you also need to tell us if you have a mandatory access control system which might prevent a a.out from executing – symcbean Aug 27 '16 at 23:17

4 Answers4

2

As far as I know it can't be done with the default tools in linux and one of the tools mentioned below should be downloaded.

If you get the relevant permissions to install the tools, then you can do that by either installing tmux or screen, but I believe tmux is the better choice as it has way more functionality.

Basically it goes like that, let's say you have 2 machines which are called box1 and box2:

  1. On box1 start a tmux session by issuing the following command: tmux new-session -s shared
  2. ssh from box2 to box1 and run the following command: tmux attach-session -t shared
  3. Start working and everything which is written in box1's tmux will be written simultaneously in box2's tmux as well and vice versa.

In order to install tmux or screen, run:

sudo apt-get install tmux screen -y

More information can be found here.

Itai Ganot
  • 10,644
  • 29
  • 93
  • 146
  • the OP stated that he don't have privilege to install anything, so your answer isn't solving any of his problems. – Marcel Aug 25 '16 at 08:47
0

Assuming you don't have root access to those boxes and you don't want to install anything even as a regular user, you might want to use mesg and send messages directly to terminals, for example:

  • make sure messaging is enabled jacek@server1:~$ mesg is n jacek@server1:~$ mesg y jacek@server1:~$ mesg is y
  • note your tty or pty jacek@server1:~$ tty /dev/pts/9
  • from server2: jacek@server2:~$ echo "This is a message" | ssh jacek@server1 'cat - > /dev/pts/9' This is what you'll get on server1's pts9: jacek@server1:~$ This is a message

You can also do the same thing the other way around, from server2 to server1. who -wT will also show you which terminals are currently writable to. Those with "-" in the second column indicate no messaging permissions. "+" indicates you can send messages to that terminal. jacek@server1:~$ who -wT jacek + tty7 2016-08-17 20:22 jacek - pts/0 2016-08-25 13:15 (:0.0) jacek + pts/1 2016-08-26 21:23 (:0.0)

There are some suggestions in this thread as well if you can actually install any kind of software: https://unix.stackexchange.com/questions/72320/how-can-i-hook-on-to-one-terminals-output-from-another-terminal

0

The perl script ttylog might be what you are looking for. Hopefully, your box has perl installed and you can just run this script without actually "installing" anything.

See this answer on Unix&Linux Stack Exchange which might solve your problem.

I will not repeat the answer here since it is already in the StackExchange network.

corny
  • 285
  • 1
  • 6