2

I am trying to poke/ping a remote Linux machine without using ssh. Is there any other utilities to do this?

Addition: It would be quite a lot of helpful if poke can be done without providing the remote machine's password. Is it possible?


Update: I came to know about write and wall tools. Anybody know how to use them?

4

2 Answers 2

2

knockd may be your answer.

Server part:


  1. Install knockd --> sudo apt-get install knockd
  2. Edit configuration file --> sudo nano /etc/knockd.conf also you can use gedit or vi.
  3. The configuration file should look like this after the edit:

    [options]
            LogFile     = /var/log/knockd.log
            Interface   = wlan0
    [sendMessage]
            sequence    = 1111,2222
            seq_timeout = 5
            command     = /usr/bin/env sh -c "echo 'Hello, World' | wall"
            tcpflags    = syn
    

    Where Interface is the listening network interface, sequence is the port knocking sequence and command is the command to be executed when knocked.

  4. Edit startup file --> sudo nano /etc/default/knockd
    In this file you only need to change START_KNOCKD=0 to START_KNOCKD=1

  5. Reload knockd to apply changes with sudo /etc/init.d/knockd reload

Client part:


Simply telnet in that order the server ports and the command will be executed

telnet MYSERVER 1111
telnet MYSERVER 2222

You can also use the knock utility:

knock MYSERVER 1111 2222

Final notes


  • You can also view those connections in the Logfile specified, (i.e. /var/log/knockd.log)
  • You can use a more complex port combination (i.e. 5555,5050,3333,3030)
  • You can read the entire documentation at the developer's webpage
  • You can read a great tutorial on the ubuntu community
2

You can try nc (netcat) to send/receive any messages (files too) over the network.

For example the computer A has IP address 192.168.1.10 and computer B has IP address 192.168.1.20.

At first open a port on computer A to which the computer B will connect to:

$ nc -l 2000

Now Computer A will listen for incoming connections on port 2000, you should use any port other than "0-1023" i.e. well known ports.

Now we will make a connection from computer B to the port 2000 of computer A:

$ nc 192.168.1.10 2000

Now the computers will be connected and you can write any message from computer A which will be displayed on computer B and vice versa.

2
  • you are always amazing brother.
    – Raja G
    Aug 4, 2018 at 5:30
  • @Ten-Coin Thanks for you kind comment. Glad I could help :)
    – heemayl
    Aug 4, 2018 at 9:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .