Git Product home page Git Product logo

rbenv-sudo's Introduction

rbenv-sudo

rbenv-sudo is a plugin for rbenv that allows you to run rbenv-provided Rubies and Gems from within a sudo session.

Implementation

It does so by prepending rbenv's bin/ and shims/ directories to a hardcoded representation of root's $PATH. It differs from rvmsudo in that it doesn't pass your present $PATH or any other environment variables over to the sudo session, in the hope of damage limitation.

It will function with the common sudo configuration of:

Defaults env_reset, secure_path

rbenv-sudo should still be used with some caution. Bear in mind that any Rubies, Gems or other binary shims, could maliciously take precedence over system binaries of the same name.

Installation

  1. Setup rbenv

  2. Make sure you have a plugins directory:

     mkdir ~/.rbenv/plugins
    
  3. Clone rbenv-sudo into the plugins directory:

     git clone git://github.com/dcarley/rbenv-sudo.git ~/.rbenv/plugins/rbenv-sudo
    

Usage

Prefix your use of sudo with the rbenv command:

$ rbenv sudo chef-solo --version
Chef: 0.10.8
$ rbenv sudo ruby --version
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
$ rbenv sudo ruby -e "puts Process.uid"
0

License

This code is provided under the MIT license.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.