June 11th, 2010 Add Your Comments

Tired of having to su to your sudo users on your dreamhost server?  Here’s a quick script to help.

Requirements:

  • You have a sudouser setup on your dreamhost account.  These are only available for private servers.
  • Make sure ~/bin is in your path.

Now to the good stuff.

Puth the following code into ~/bin/sudo

    #!/bin/sh
    su yoursudouser -c "/usr/bin/sudo $*"

    Make the file executable

      $ chmod +x ~/bin/sudo

      You can now do the following from your normal user:

      $ sudo ls