How can I restrict the permissions of a specific user in Ubuntu?
To ban a user’s access, you can follow these steps:
- Open the terminal window.
- Login using the root user or a user with sudo privileges.
- Use the following command to add a user to the sudo group, this will allow the user to have administrator privileges:
- Add the user to the sudo group.
- The username corresponds to the username of the user who is to be banned.
- If a user has been added to the sudo group, you can use the following command to remove them from the sudo group:
- Remove the user named “username” using sudo.
- The username is the username of the user whose access needs to be restricted.
- To fully restrict a user’s permissions, you can remove them from the sudo group and all other groups using the following command:
- Remove the user and its home directory.
- The username is the username of the user whose banning privileges are to be revoked.
- After banning user privileges, restart the system to make the changes take effect.
- Restart the system as a superuser.
Please be advised that restricting user access may have an impact on system functionality and other users, so please proceed with caution.