1. Liebe Forumsgemeinde,

    aufgrund der Bestimmungen, die sich aus der DSGVO ergeben, müssten umfangreiche Anpassungen am Forum vorgenommen werden, die sich für uns nicht wirtschaftlich abbilden lassen. Daher haben wir uns entschlossen, das Forum in seiner aktuellen Form zu archivieren und online bereit zu stellen, jedoch keine Neuanmeldungen oder neuen Kommentare mehr zuzulassen. So ist sichergestellt, dass das gesammelte Wissen nicht verloren geht, und wir die Seite dennoch DSGVO-konform zur Verfügung stellen können.
    Dies wird in den nächsten Tagen umgesetzt.

    Ich danke allen, die sich in den letzten Jahren für Hilfesuchende und auch für das Forum selbst engagiert haben. Ich bin weiterhin für euch erreichbar unter tti(bei)pcwelt.de.
    Dismiss Notice

Umleitung /dev/pty nach /dev/null

Discussion in 'Linux-Distributionen' started by ludwfan, Sep 20, 2009.

Thread Status:
Not open for further replies.
  1. ludwfan

    ludwfan Byte

    Hallo

    Ich las dies in einem anderen Forum und wollte nur kurz wissen ob das wirklich machbar ist und wenn ja wie

    Also unter Linux ist es möglich, eine virtuelle serielle Schnittstelle /dev/pty mit dem virtuellen Gerät /dev/zero zu verbinden. Darüber ist es auch möglich, eine Internetverbindung zu simulieren.
     
  2. tempranillo

    tempranillo Guest

    Ich bin mir ziemlich sicher, dass der Thread ganz flott in /dev/null landet. :D
     
  3. ludwfan

    ludwfan Byte

    Wo kann man denn die Befehle eingeben?
     
  4. qqqaqqq

    qqqaqqq Megabyte

  5. neppo1

    neppo1 Halbes Gigabyte

    @tempranillo
    er spielt wohl hierrauf an.....SOCAT

    EXAMPLE FOR REMOTE TTY (TTY OVER TCP) USING SOCAT

    You have a host with some serial device like a modem or a bluetooth interface
    (modem server)
    You want to make use of this device on a different host. (client)

    1) on the modem server start a process that accepts network connections and
    links them with the serial device /dev/tty0:

    $ socat tcp-l:54321,reuseaddr,fork file:/dev/tty0,nonblock,waitlock=/var/run/tty0.lock

    2) on the client start a process that creates a pseudo tty and links it with a
    tcp connection to the modem server:

    $ socat pty,link=$HOME/dev/vmodem0,waitslave tcp:modem-server:54321

    NETWORK CONNECTION

    There a some choices if a simple TCPv4 connection does not meet your
    requirements:
    TCPv6: simply replace the "tcp-l" and "tcp" keywords with "tcp6-l" and "tcp6"
    Socks: if a socks server protects the connection, you can replace the
    "tcp:modem-server:54321" clause with something like
    "socks:socks-server:modem-server:54321" or
    "socks:socks-server:modem-server:54321,socksport=1081,socksuser=nobody"

    SECURITY

    SSL
    If you want to protect your server from misuse or your data from sniffing and
    manipulation, use a SSL connection with client and server authentication
    (currently only over TCPv4 without socks or proxy).
    See <a href="socat-openssl.txt">socat-openssl.txt</a> for instructions.

    IP Addresses
    !!! bind=...
    !!! range=...
    !!! lowport (for root)
    !!! sourceport
    !!! tcpwrap=

    FULL FEATURES
    $ socat -d -d ssl-l:54321,reuseaddr,cert=server.pem,cafile=client.crt,fork file:/dev/tty0,nonblock,echo=0,raw,waitlock=/var/run/tty0.lock

    TROUBLESHOOTING
    -v -x



    ./socat tcp-l:54321,reuseaddr,fork file:/dev/ttyS0,nonblock,raw,echo=0,crnl,waitlock=/var/run/tty

    while true; do ~/Develop/socat-1.4.3.0/socat pty,link=$HOME/dev/vmodem0,raw,echo=0,waitslave tcp:192.168.0.132:54321; done

    socat -,icanon=0,echo=0,min=0,ignbrk=0,brkint,isig,crlf $HOME/dev/vmodem0


    // server:
    socat tcp-l:54321,reuseaddr,fork file:/dev/ttyS0,nonblock,raw,echo=0,waitlock=/var/run/tty

    // clients:
    while true; do socat pty,link=$HOME/dev/vmodem0,raw,echo=0,waitslave tcp:192.168.0.132:54321; done

    // interactive test:
    socat -,icanon=0,echo=0,min=0,isig,icrnl=0 $HOME/dev/vmodem0

    Inwieweit SOCAT funktioniert, wirst du selbst beurteilen müssen.



    Gruß
    neppo
     
  6. tempranillo

    tempranillo Guest

    @ neppo
    Mag sein. Danke. ;)
     
  7. ludwfan

    ludwfan Byte

    Danke ebenfalls.
     
  8. Rattiberta

    Rattiberta Halbes Gigabyte

    => Titel geändert
    Bitte zukünftig Titel wählen, aus dem das Problem ersichtlich ist!
     
Thread Status:
Not open for further replies.

Share This Page