How to create a user with root privileges in bash?
Posted
by
George Edison
on Ask Ubuntu
See other posts from Ask Ubuntu
or by George Edison
Published on 2011-03-30T22:31:13Z
Indexed on
2012/11/06
17:22 UTC
Read the original article
Hit count: 296
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?
© Ask Ubuntu or respective owner