# Cannot su or use sudo



## walterbyrd (Apr 14, 2015)

Brand new FreeBSD installation.

When I try to sudo I get 
	
	



```
sudo: not found
```

When I try to su I get 
	
	



```
su: sorry
```

What can I do?


----------



## tobik@ (Apr 15, 2015)

I am quoting su(1):


> PAM is used to set the policy su(1) will use.  In particular, by default
> only users in the “wheel” group can switch to UID 0 (“root”).


So the quickest way to solve this is to add your user to the wheel group with `pw usermod walterbyrd -G wheel`

For sudo install security/sudo with `pkg install security/sudo`. You then also need to edit /usr/local/etc/sudoers to set it up for either the wheel group or your user account.


----------



## Oko (Apr 15, 2015)

Do you know how to edit /usr/local/etc/sudoers? `man visudo`. Note that sudo on UNIX is used to give privileges to a user to execute a single command for which super user account is required. Everything that Ubuntu does with sudo is WRONG!


----------



## Deleted member 9563 (Apr 15, 2015)

Just my opinion, but I don't think that users of FreeBSD generally require `sudo`. In Ubuntu it makes sense when it is assumed that the user is not aware of the importance of user privileges. I've been using out-of-the-box Debian sometimes lately, and `sudo` sure is a drag. It's a real relief when I get back to my own box where I can do what I want.


----------



## Speedy (Apr 15, 2015)

You can use `sudo -i` even when root account does not allow logins.


----------



## kpa (Apr 15, 2015)

I've found security/sudo much more handier than the other solutions. I just happen to be a person who thinks that the whole root account could have been dispensed with and replaced with a capability based security model, essentially have just one user account that could gain elevated privileges on demand. Maybe one day this is reality in UNIX


----------



## Oko (Apr 15, 2015)

OJ said:


> Just my opinion, but I don't think that users of FreeBSD generally require `sudo`.


It is useful to give a junior system admin privileges to execute few commands without giving out the whole system to a guy. At home I am using sudo on my OpenBSD desktops only to mount external file systems USB, DVD, Cameras (Please no flames OpenBSD has its own indigenous auto mounting daemon but some people like yours truly just don't like to use it). I am with you. When I do really system administration the first command is `su -`


----------



## Clara James (Apr 22, 2015)

Facing the same problem


----------



## SirDice (Apr 22, 2015)

Same solution, security/sudo needs to be installed and configured and only members of the wheel group are allowed to su(1).


----------

