{"id":34514914,"url":"https://github.com/ensc/r-cuse2net","last_synced_at":"2026-04-24T14:34:46.744Z","repository":{"id":198855851,"uuid":"666737786","full_name":"ensc/r-cuse2net","owner":"ensc","description":"Implements a CUSE device which relays operation to a remote server","archived":false,"fork":false,"pushed_at":"2024-04-27T12:11:40.000Z","size":118,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-27T13:54:58.473Z","etag":null,"topics":["cuse","linux","rust","ser2net","tty"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ensc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-15T12:10:46.000Z","updated_at":"2024-04-27T13:55:01.497Z","dependencies_parsed_at":null,"dependency_job_id":"9b2d0d3c-c220-4776-9422-cc60292402ad","html_url":"https://github.com/ensc/r-cuse2net","commit_stats":null,"previous_names":["ensc/r-cuse2net"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ensc/r-cuse2net","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ensc%2Fr-cuse2net","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ensc%2Fr-cuse2net/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ensc%2Fr-cuse2net/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ensc%2Fr-cuse2net/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ensc","download_url":"https://codeload.github.com/ensc/r-cuse2net/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ensc%2Fr-cuse2net/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32227763,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cuse","linux","rust","ser2net","tty"],"created_at":"2025-12-24T04:20:04.677Z","updated_at":"2026-04-24T14:34:46.739Z","avatar_url":"https://github.com/ensc.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# About\n\nr-cuse2net implements a [CUSE](https://lwn.net/Articles/308445/)\ndevice which relays operations on it to a remote server.\n\nAt the moment, only the most important functionality for TTY devices\nis implemented.\n\nIt was implemented to make serial devices in podman containers available\nand allow reconnecting them without restarting the container.\n\nIt consists of:\n\n - a server part (`cuse2net-dev`) which listens on the network and\n   speaks with the real device. This program does not need special\n   permission\n\n - a client part (`cuse2net-cuse`) which implements the cuse device and\n   speaks with the server.  This program requires access to `/dev/cuse`\n   (see SECURITY below)\n\n# Usage\n\n## cuse2net-dev server\n\n```\nRun character devices over network\n\nUsage: cuse2net-dev [OPTIONS] --device \u003cDEVICE\u003e\n\nOptions:\n      --log-format \u003cFMT\u003e  log format [default: default] [possible values: default, compact, full, json]\n  -l, --listen \u003cIP\u003e       ip address to listen on [default: ::]\n  -p, --port \u003cPORT\u003e       port to listen on [default: 8000]\n  -d, --device \u003cDEVICE\u003e   device\n  -h, --help              Print help\n  -V, --version           Print version\n```\n\n## cuse2net-cuse client\n\nRun character devices over network\n\n```\nUsage: cuse2net-cuse [OPTIONS] --server \u003cserver:port\u003e --device \u003cDEVICE\u003e\n\nOptions:\n      --log-format \u003cFMT\u003e      log format [default: default] [possible values: default, compact, full, json]\n  -s, --server \u003cserver:port\u003e  device major number\n  -m, --major \u003cnode-major\u003e    device major number\n      --minor \u003cnode-minor\u003e    device minor number\n  -d, --device \u003cDEVICE\u003e       device name (without /dev)\n  -h, --help                  Print help\n  -V, --version               Print version\n```\n\n## Examples\n\n### server\n\n```\ncuse2net-dev --device /dev/serial/by-path/pci-0000:00:14.0-usb-0:3:1.0-port0 --listen 127.0.0.1 --port 9001\n```\n\n### cuse\n\n```\ncuse2net-cuse --device ttyCUSE0 --major 450 --minor 100 --server 127.0.0.1:9000\n```\n\nor (when using the systemd services in [contrib/](contrib/)\n\n```\n# cat \u003c\u003cEOF \u003e/etc/sysconfig/cuse2net-ttyCUSE0.conf\nSERVER_IP=127.0.0.1\nSERVER_PORT=9000\nCUSE_MAJOR=450\nCUSE_MINOR=100\n# RUST_LOG=debug\nEOF\n\n# systemctl enable cuse2net-cuse@ttyCUSE0\n```\n\n### ESP32 IDF within podman\n\n```\npodman run --device=/dev/ttyCUSE0:rwm ...\nesptool esp32 -p /dev/ttyCUSE0 ...\n```\n\n# Security\n\n## /dev/cuse\n\n`cuse2net-cuse` can run as an arbitrary user and needs only access to\n`/dev/cuse`.  But in opposite to the related `/dev/fuse` device, it is\nnot recommended to open its permissions too much (e.g. **do not** make\nit world accessible).\n\nCUSE allows reading and writing of arbitrary memory of a program which\nruns an `ioctl()` on it.\n\nHence, keep permissions of `/dev/cuse` restricted and run `cuse2net-cuse`\nas a privileged user.\n\n\n## `cuse2net-cuse`\n\nProgram should run as a privileged user (see above).  There is no\nspecial risk regarding the CUSE related operations\n\n\n## `cuse2net-dev`\n\nProgram needs access to the real device which can be accomplished by\nspecial `udev` rules.\n\nIt runs `ioctl` requested from the client program.  At the moment only\na limited amount of ioctl are allowed, but when arbitrary ones are\npossible, special crafted arguments might override memory and allow\nattacks on the server.\n\n\n## client program\n\nAs written above, the program that accesses the device generated by\n`cuse2net-cuse` is defenseless at its mercy.\n\n\n# TODO\n\n- make `ioctl` on server side non-blocking\n\n- implement more `ioctl`\n\n- implement USB\n\n- create an abstraction over ioctls; currently, it is expected that\n  ioctl codes on server and client side are identical\n\n# Supported clients\n\n- ESP32 IDF\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fensc%2Fr-cuse2net","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fensc%2Fr-cuse2net","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fensc%2Fr-cuse2net/lists"}