Skip to content

Instantly share code, notes, and snippets.

@supechicken
supechicken / crosh-su
Last active March 6, 2024 12:08
A simple `su` client/daemon script for ChromeOS crosh shell
#!/usr/bin/env ruby
# CroshSU: "Fix" sudo in crosh by redirecting all sudo calls to VT-2 shell, inspired by root solutions on Android
#
# Usage: put this script into /usr/local/bin, run `crosh-su --daemon` in VT-2 and run
# some command with `crosh-su --client <command you want to run with root>` in crosh
#
require 'io/console'
require 'socket'
require 'pty'
require 'fileutils'