WCG WCG - 1 year ago 147
Git Question

Cannot use git hub extension as root

What do I need to run git hub as root?

git hub
works perfectly in non root user.

To install it as root, I ran
brew install hub
which lead to

# brew install hub
W: be careful as root.

You may want to update following environments after installed linuxbrew.


(example: /usr/share/doc/linuxbrew-wrapper/examples/profile)
Don't run this as root!
/usr/lib/linuxbrew-wrapper/install:110: warning: Insecure world writable dir /root in PATH, mode 040777

It seems to linked with
ran as root.

The alternative would be to use
sudo -u
, but the command is not recognized. Why is it so?

$ sudo -u user 'git hub user myuser'
sudo: git hub user myuser: command not found

Answer Source

The solution is to install hub from a regular user.

$ brew install hub

and to add /usr/local/bin to the $PATH of root user (if it's not already the case.)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download