How to create a user with root privileges in bash?
- by George Edison
I have run the following commands:
sudo groupadd -r testgroup
sudo useradd -g testgroup -M -r testuser
Notice the -r option, which according to the man page:
-r
Create a system account.
Assuming I have a user account with root privileges, I then run:
sudo -u testuser cat /dev/input/mouse0
However, I get:
cat: /dev/input/mouse0: Permission denied
Running the same command as root provides the expected output (garbled output from the mouse driver).
How can I create a user with root privileges?