This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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' |