How To Execute A Command With Superuser Privilege In FreeBSD?

How To Execute A Command With Superuser Privilege In FreeBSD?


This post was last updated on August 1st, 2020 at 10:28 am

A superuser or root user is a most privileged user account in FreeBSD. It has access to all the commands and files of the system. A root user or superuser is also called the administrator because it is needed to perform all the administrative tasks.

With superuser privileges, you can perform tasks such as installing software, changing the ownership and permissions of files, and managing other user accounts which can not be done with a normal user account.

In this article, we will discuss how a normal user can execute a command with superuser privileges in FreeBSD.

How to become superuser in FreeBSD

In FreeBSD, there are various ways to gain superuser privilege. You can log in with the root account, this is not recommended for day to day tasks such as sending and receiving emails, programming, etc. Misuse of root account can damage the system as it operates without limits.

Instead, use the su command with a – (dash) to inherit the root user’s environment. Also, it is advised to double-check any command before you execute it as a superuser.

Using root account in FreeBSD

In FreeBSD, a standard root account is created while the installation of the operating system. You can log in as root by entering root as the login and password and then you can start using it. Generally, it is used to perform administrative tasks.

Using su to become superuser in FreeBSD

To become the superuser using su command you should run the following command in your terminal –

su -

The user who is running this command must be in the wheel group otherwise the command will fail. You can use the given command to add a user in the wheel group –

pw groupmod wheel -m lalit

And also the user must know the password of the root user account.

Use any of the given methods to become the superuser and then execute any command that requires extra privileges.


There are other ways such as using sudo which can also be used to execute a command with superuser privilege. Now if you have any thoughts on this topic, you can share with us in the comments below.

Previous [ubuntu] Init Failure & Segmentation Fault
Next [ubuntu] Keybord issuse in asus laptop

About author

You might also like

Linux Topics 0 Comments

How To Kill A Running Process In Linux/Unix?

This post was last updated on August 1st, 2020 at 12:44 pmIn Linux, a process is an instance of a program that is running on a computer. When a program

How To 0 Comments

How To Install And Use sudo In FreeBSD?

This post was last updated on August 1st, 2020 at 10:28 amThe sudo (superuser do) is a program for Unix like operating systems. It allows a user to run a

FreeBSD 0 Comments

[FreeBSD] How to Install FreeBSD OS, Step by step guide using a virtual machine

This post was last updated on November 3rd, 2020 at 05:18 pmTake a deep breathe and be sure that you have at least an hour of time. We have to


No Comments Yet!

You can be first to comment this post!

Leave a Reply