Non root user can create group?
Hi,
I am newbie. I got a linux server machine and need to create a new user to existing group of the machine. My question is can a NON root user can do this task? if yes how? I found uid is non zero value of my login and by googling I found that root user uid is 0. So I am considering I am not a root user. Please provide your inputs. Thanks, cdhar |
A non-root user cannot create a new user or group and may not modify any user or group.
You must either (1) log in as root or (2) use su - or (3) use sudo to add or modify users or groups. The UID for root is zero, everything or everybody else is non-zero; do not mess with that (as in, do not change any other user account to zero -- you can quickly break things). Hope this helps some. |
No. Login as root using su and then useradd <username> .
|
Thanks for quick inputs. So how to get root privilege to my account?
|
You don't add root privilege to your account, You will launch the necessary commands logged in as root or using the sudo command. Which one to choose depends on your distribution and/or how your machine is set up.
|
Assalam o Alaikum.
"So how to get root privilege to my account?" run this command as a root "visudo" -add following line below root ALL=(ALL) ALL username ALL=(ALL) ALL -add following line below # %wheel ALL=(ALL) NOPASSWD: ALL username ALL=(ALL) NOPASSWD:ALL save and exit then try sudo su sudo useradd etc |
This is bad advice, in many ways, I will explain to you why:
Quote:
Quote:
Quote:
Security is a serious topic. If you have not a proper understanding about it please inform yourself before giving advices to newbies. @cdhar: To give you better advice we need to know which distribution you are running on the machine where you have to change the user/group. |
Actually I achieved same task through the same way thats why I shared. Ok dear you are right.
|
Quote:
Code:
prompt: su - By the way, you most likely have a utility named adduser. Once you've done the su -, simply Code:
prompt: adduser Code:
exit Hope this helps some. |
All times are GMT -5. The time now is 06:43 PM. |