{"id":18378830,"url":"https://github.com/chromebrew/crew-sudo","last_synced_at":"2025-08-19T05:11:50.155Z","repository":{"id":203556902,"uuid":"697692955","full_name":"chromebrew/crew-sudo","owner":"chromebrew","description":"Workaround for using sudo on ChromeOS crosh shell (ChromeOS v117+)","archived":false,"fork":false,"pushed_at":"2024-10-29T05:28:55.000Z","size":54,"stargazers_count":11,"open_issues_count":5,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-06T22:38:20.803Z","etag":null,"topics":["chromeos","chromiumos","linux"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/chromebrew.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-09-28T09:23:06.000Z","updated_at":"2025-04-05T09:43:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"82ffa314-a907-46ee-888c-f8eece4901a0","html_url":"https://github.com/chromebrew/crew-sudo","commit_stats":null,"previous_names":["supechicken/crew-sudo"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/chromebrew/crew-sudo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chromebrew%2Fcrew-sudo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chromebrew%2Fcrew-sudo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chromebrew%2Fcrew-sudo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chromebrew%2Fcrew-sudo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chromebrew","download_url":"https://codeload.github.com/chromebrew/crew-sudo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chromebrew%2Fcrew-sudo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271103202,"owners_count":24699646,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-19T02:00:09.176Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["chromeos","chromiumos","linux"],"created_at":"2024-11-06T00:35:53.138Z","updated_at":"2025-08-19T05:11:50.118Z","avatar_url":"https://github.com/chromebrew.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# crew-sudo\nMake `sudo` \"works\" on ChromeOS `crosh` shell (ChromeOS v117+) by redirecting sudo calls to VT-2 shell.\n\n## Background\nOn ChromeOS v117, all Chrome-related processes (e.g. the ChromeOS UI) is executed with the `NO_NEW_PRIVS` bit, which means:\n  - `suid/sgid`-bit is blocked, and thus no more `sudo`\n  - This flag will be inherited by its subprocess (including `crosh`) and cannot be unset\n\nThat benefits security. However, it is bad for [Crouton](https://github.com/dnschneid/crouton)/[Chromebrew](https://github.com/chromebrew/chromebrew) users.\n\nThe official workaround for this is using the VT-2 shell (aka `frecon`) [^1], but `frecon` just sucks:\n  - No clipboard support\n  - No Caps Lock support\n  - No HiDPI support\n  - Poor compatibility with TUI programs\n\nSo is there a way to call `sudo` in `crosh` but run it in VT-2? That's what this project does :)\n\n[^1]: `sudo` works in VT-2 because the VT-2 process is independent of the browser process and executed without the `NO_NEW_PRIVS` bit\n\n## How it works?\nIt works in a similar way compared with popular Android root solutions like Magisk or SuperSU. It is divided into 2 parts:\n  - A `sudo` server running in VT-2 for executing `sudo` requests from `crosh`\n  - A `sudo` client for sending `sudo` requests to the server from `crosh`\n\nAll communication between the `sudo` server and client is done via Unix socket.\n\n![How it works](images/how-it-works.svg)\n\n## Usage\nAll you need to do is start the `crew-sudo` daemon in VT-2 and `sudo` will work again in `crosh` :)\n\n```text\nsudo \u003ccommand to execute or sudo options\u003e\n---\ncrew-sudo [command] \u003coptions\u003e\ncrew-sudo -h|--help\ncrew-sudo -V|--version\n```\n\n|Command       |Description|\n|:-------------|:----------|\n|`client`      |Run as client mode, pass all given command arguments to daemon|\n|`daemon`      |Run as daemon mode, listen incoming requests at `/tmp/crew-sudo.socket`|\n|`stop-daemon` |Stop currently running `crew-sudo` daemon|\n\n---\n\n|Options       |Description|\n|:-------------|:----------|\n|`--bashrc`    |Suppress `daemon is already running` error|\n|`--foreground`|Run `crew-sudo` daemon in foreground|\n|`--replace`   |Replace the currently running `crew-sudo` daemon|\n\n## What works currently\n- Send terminal input to command/send command output back to `crosh`\n- Handle terminal size events\n- Sync exit code\n\n## License\nCopyright (C) 2013-2024 Chromebrew Authors\n\nThis project including all of its source files is released under the terms of [GNU General Public License (version 3 or later)](http://www.gnu.org/licenses/gpl.txt).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchromebrew%2Fcrew-sudo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchromebrew%2Fcrew-sudo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchromebrew%2Fcrew-sudo/lists"}