How to grant permissions to a new user in Ubuntu?

In Ubuntu, you can grant permissions to new users using the following steps.

  1. create a new user
  2. freshly registered user
sudo adduser newuser
  1. Add new users to the sudo group: If you want to give new users administrative privileges, you can add them to the sudo group. Run the following command:
sudo usermod -aG sudo newuser
  1. Execute with superuser privileges.
sudo -l -U newuser
  1. Change the permissions on a file or directory
  2. The directory path for web content is /var/www/html.
sudo chown -R newuser:newuser /var/www/html
  1. Change mode
  2. The file index.html is located in the directory /var/www/html.
sudo chown newuser /var/www/html/index.html

Please note, in order to ensure system security, it is important to carefully review and allocate user permissions, while avoiding granting unnecessary permissions.

bannerAds