In pretty much any GNU/Linux distribution you use sudo or su, What's the right choice for FreeBSD 10 ?
Asked
Active
Viewed 5.0k times
32
user2485710
- 1,403
- 4
- 15
- 26
1 Answers
42
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
slm
- 363,520
- 117
- 767
- 871
-
Is there any way for "syntax=sh" or similar extensions? They are very useful for colorized interface. – Sopalajo de Arrierez Jan 07 '16 at 00:00