How to grant permissions to a new user in Ubuntu?
In Ubuntu, you can grant permissions to new users using the following steps.
- create a new user
- freshly registered user
sudo adduser newuser
- 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
- Execute with superuser privileges.
sudo -l -U newuser
- Change the permissions on a file or directory
- The directory path for web content is /var/www/html.
sudo chown -R newuser:newuser /var/www/html
- Change mode
- 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.