Can we create multiple users with same UID?

  • Can we create multiple users with same UID?
  • Can we give root permissions to normal user like admin.s ? If YES give me full details (syntax of sudo/RBAC)

Multiple users with same UID is not possible. However, you could add multiple users to a particular group and change the permissions accordingly.

 man group

should give you a better idea.

You can give multiple users sudo permissions ...

man sudo

should give you the initial help you want.

add new user using usradd admin . and after that in /etc/passwd file change its uid to root's uid .

@OP: We are all volunteers and do not take orders. Please keep that in mind, thanks..

---
The UNIX and Linux Forums

YES SR! NO SR!

GOOGLE NOW! THEN COME AND ASK... SR!

hello all, i apologize... i just forgot to put PLEASE and i am not ordering anyone... don't mind... and one more thing if i get answers from Google for my questions why should i drop threat here? Thanks for suggestions everyone. :frowning:

It is not just the PLEASE. Is the whole question attitude:

1- No please... or hello, presentation anything,

2- No introduction on OS version, platform, etc... so we have to guess?

3- "f YES give me full details (syntax of sudo/RBAC)", This phrase talk by itself

4- And this is the most important one... you are not even trying... have you read about sudo/rbac? have you tried any configuration? have you faced any wall? Did you get any errors? if yes, which ones? If you already search on google... what did you find so we know where you are...

Last one... a comment like "suggestions are welcome", "help would be appreciated" "if you can point me in the right direction" would be more than nice as well....

Juan

I would like to make a comment here. It's off the topic though.

Although I'm just another user of the forum, not a moderator/admin, I would request posters not to be harsh as not all of the people who post here have English as their first language. Please be patient. Thanks.

It is not a recommended practice but yes, multiple users can share the same userid. You can have multiple entries with the same user id, but different home directories, gecos, shells and password. However, technically, they would be the same user for the kernel and for all commands.

sudo is not part of Solaris 10 and older. Should you want to give a user full root permissions, grant him/her the primary administrator profile.

usermod -P "Primary Administrator" username

or have the following line in /etc/user_attr

 12345::::type=normal;profiles=Primary Administrator

If you are going to use RBAC, remember to use a privilege shell like pfsh, pfcsh or pfksh... otherwise you won't be able to use the auths / profiles

Juan

@admin_xor- the policy here is definitely one of do not be rude. However I suspect that ESL (English as a second language) holds for all of the posters in this thread. This means that people who behave brusquely by someone else's standards may be called on it.

There is a strong cultural component to behavior and the perception of behavior. Which, IMO, is good thing as long as it doesn't create flame wars. We cannot enforce "internet manners" - what Juan B was complaining about.

FWIW, posters who are abusive are tracked, warned, and if necessary, banned. Nothing I see in the thread warrants anything even remotely like that on the part of anyone here.

Keep up the good work, everyone.

And. Multiple human users with the same uid is a horrible idea. It is a problem waiting to happen. My perception is that the OP should use a group approach like the rest of us all do. Most application software makes implicit assumptions about the uniqueness of the uid.
When that assumption is violated really bad things can happen. And if there is an application that mandates a common uid, each user should be able to become a single special username to accomodate the app. Not the other way around.

Thankyou jlliagre

or simply prefix the command by pfexec, which makes it similar to sudo.

---------- Post updated at 10:43 ---------- Previous update was at 10:02 ----------

Agreed. I suspect the OP is not looking to human users sharing an uid but investigating aliasing root, i.e. a technical account. Creating root aliases is a practice I have no particular problem with, especially for a limited period of time. Allowing direct root login in the first place is more of an issue. The (slow) trend is to forbid that to happen and enforce using either sudo or rbac. With Solaris 11, root is by default a role. Solaris 10 can be configured the same way.

no we cant create so many user with same uid......

one user have only one uid..

This is incorrect. Nothing prevent a single uid to match zero, one, two or any number of usernames. The useradd command even has the specific switch -o to allow it.

This in incorrect too. A single user(name) can have multiple password entries, although that would be a very poor and confusing practice.