Hi. I've been using Zorin 18 for a couple of months & am generally very pleased with it. I've created a second account with non administrator privileges. However, this means I can't run commands from the terminal when logged into this account. Is it possible to use the administrator sudo privileges whilst using terminal in the non administrator account?
I dont know if what i'm about to say will work, but you can try replacing sudo with pkexec in your command. It should show a popup that app can use for asking for privilegies, but the cool thing is that i think if the current account doesn't have sudo, it will ask for the password of another account of the system (like on Windows, where UAC would ask for the password of an admin account if using a non-admin account).
Maybe i'm wrong or maybe this isn't the correct command, i'm not currently on my Zorin PC and cant test it.
I tested it on Zorin live boot stick yesterday and it worked.
Use 'pkexec' instead of 'sudo' in the command, e.g.
pkexec apt install synaptic
pkexec apt remove evolution
or
pkexec apt update && pkexec apt upgrade
Yes because you still used sudo in your command.
In any command that starts by sudo, just replace sudo with pkexec.
For example, with the command you tried, the correct command would be :
pkexec apt install xserver-xorg-input-synaptics
You can also do the following if you want to run sudo commands from a non-sudo authorized account, using a different sudo authorized account:
Open Terminal.
- Type:
su *yoursudousername* - Type yoursudousername's passwd (this will drop you into this users shell)
- You can then run sudo commands independently, or you can run the following command:
sudo -s
This will drop you into a sudo shell (not needing to type sudo before everything, nor needing to enter a passwd after everything) <<- use with CAUTION.
Hope that helps!
It would be good to know why you need to do this, though. The idea of having admin and non-admin accounts is to restrict this type of operations to those accounts that are in charge of administering the system.
If you need to run a one-off command, then you should log in as your admin account and run it from there. Or contact the admin for your system. However, if there are a few commands that you find are important to be able to run from that non-admin account, then you can configure your system to allow access only to those commands.
Depending on your needs, we can recommend different options. But, generally speaking, it's best to follow the principle of least privilege so that each user has access only to what it needs and nothing more.



