How To Add Or Remove A User In FreeBSD?


FreeBSD is a free and open-source Unix-like operating system descended from the Berkeley Software Distribution. It is used to power modern servers, desktops, and embedded platforms. FreeBSD is a multi-user operating system that means many users can have accounts on a single system and they can use it’s resources simultaneously.

Anyone who wants to use the system should have a user account on it. So in this article, we will discuss adding or removing users and giving them the required permissions in FreeBSD.

How to Add a User on FreeBSD

The adduser command is recommended for adding a new user to FreeBSD. When a new user is added, the program automatically updates /etc/passwd and /etc/group files. It also creates the home directory for the new users.

Now use the following command to add a new user –

adduser

It will ask to enter some information about the user, enter it. Now a new user will be created.

How to edit User Information on FreeBSD/h2>
You can use chpass command to edit the information such as default shell, and the personal information associated with a user account. From root account or with superuser privileges you can change the information of any user account.

Now use the following command to change the information of a user –

chpass user_name

For example –

chpass vaibhav

When you execute this command this will display the information of the user in a text editor. Here edit the information and save it if you want to make changes to the user account.

How to Remove a User

The rmuser command is used to remove a user in FreeBSD. You need to run it as a superuser and it will completely remove a user from a system. It can’t be used to remove a superuser account.

Now to remove a user use the following command in your terminal –

rmuser user_name

For example –

rmuser vaibhav

It will prompt you to confirm that you want to remove this account or not. Enter yes and then press the return key. In the next line, it will ask to remove the user’s home directory, if you want to remove it then enter yes and then press the return key.

Now the user will be removed from the system.

Conclusion

Now I think you should have a basic understanding of adding or removing users in FreeBSD. If you have any queries related to this topic then write us in the comments below.

Leave a Comment