Howtos / Articles

Enable su access for users in FreeBSD

On a default installation of FreeBSD you will find that you can’t SSH into the server using the root account, and any accounts that you have added, can’t run the ‘su’ command to elevate to root. To enable ‘su’ access, the user needs to be part of the ‘wheel’ group.

Note: These commands must be run from an account that has root privileges.

To add a user (in this example, a user called ‘administrator’) to the wheel group, run the following command:

# pw group mod -n wheel -m administrator

If you wish to remove a user from the wheel group, replace -m with -d as follows:

# pw group mod -n wheel -d administrator

To view the members of the wheel group, run the following command:

# pw group show -n wheel

The ‘administrator’ user should now be able to run the ‘su’ command and run commands as root.

Share this howto article!
  • Facebook
  • Twitter
  • Reddit
  • email

2 comments to Enable su access for users in FreeBSD

  • Hi. This is all well and good, but the problem that most people are trying to solve is enabling a user who doesn’t belong to wheel group to run the commands that will enable him/her to log into the host as root using su. If people had access to a user account that was part of the wheel group, these commands would work. But if the user doesn’t belong to the wheel group in the first place, these instructions are no help.

    Welcome to Planet FreeBSD. :)

  • Richard

    Kris, if a user is on a freebsd box where they’re not authorized for access to wheel or su to root, then they’re out of luck – they need to contact the system admin. If it’s their own freebsd system, they did set a root password during install, did they not? They can just logout, login as root, then run those commands to grant their personal acct access to wheel . . . not that difficult.

Leave a Reply




You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>