Transfer of information from the remote server to the local process



  • I would like to know, after the establishment ssh- Connections to the remote server to be able to transfer some information from the remote server to the triggered local process.

    e.g.I get a remote server. urland I would like to, by transferring it to a certain programme/scrypt on the remote server, "open it" url in a local browser launched.

    It's clear that a mouse can separate this. url In the terminal emulsion window, and put it in the browser's address line, and how do we do it without the mice and the "copy-paste"?


    More specificallyI'm using the remote server. https://ru.wikipedia.org/wiki/RSS - inspector http://newsbeuter.org/ (in popular distributors) gnu/linux One-name packages are present and are launched https://ru.wikipedia.org/wiki/GNU_Screen to which I'm connected with by ssh (sighs)ssh -t сервер screen -RD имя-скрина-с-newsbeuter-омand in itnewsbeuter-e() There is an opportunity to press o, open a reference to the test topic in the specified browser (default--) lynxbut the program is on the remote server, and I'd like to open a link in the remote server. local Browser.



  • for use ssh-tunnel Optical -R..about:

    $ ssh -R 1234:localhost:5678 ...
    

    after launch ssh sessions (and only during her work) sshd The remote side will listen to the specified tcpport, 1,234, and the information will be relayed to the local process listening to the second port, 5,678.

    Transmit the text (on remote server) to port 1,234, for example, through the programme netcat:

    $ echo текст | nc -q 0 localhost 1234
    

    Opposition -q 0 - I'm just saying, netcat I finished work immediately after the transfer.

    The same text can be adopted at port 5678 (also on a local vehicle) by the same programme:

    $ netcat -l -p 5678
    

    Text stdout The programme itself will complete its work by receiving a signal of completion, and it is clear that the hearing process should be launched sooner than the transmitter.


    newsbeuter and local browser:

    Transfer url-a can be requested directly in the configuration browseradding to the file ~/.newsbeuter/config a line of approximately this type:

    browser "echo %u | nc -q 0 localhost 1234"
    

    a Approximately such an endless cycle can be launched on the local side:

    $ while true; do xdg-open $(nc -l -p 5678); done
    

    xdg-open - This is a software tool for " opening " files/bases and others https://ru.wikipedia.org/wiki/URI e.g.:

    $ xdg-open /путь/к/картинке.png
    $ xdg-open http://сайт/страница
    



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2