34

In pretty much any GNU/Linux distribution you use sudo or su, What's the right choice for FreeBSD 10 ?

1 Answer 1

44

FreeBSD does support sudo it's likely just not installed by default. Installation instructions are here, titled: FreeBSD: Install sudo Command To Execute A Command As The Root.

As root:

FreeBSD < 10

# pkg_add -r sudo

FreeBSD 10+

# pkg install sudo

The default sudoers file is located here: /usr/local/etc/sudoers. To edit it and add rules you need to use the visudo command.

$ su -
$ visudo

Then to give a user access to everything as root:

userX ALL=(ALL) ALL

To become root (as userX):

$ sudo -s
-or-
$ sudo -i
1
  • Is there any way for "syntax=sh" or similar extensions? They are very useful for colorized interface. Jan 7, 2016 at 0:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .