root privileges ....

I haven't found anything on linux  that helps me answer this question. I was wondering what the command would be in linux to add a profile for my roommate that has root privileges when he logs in right off the bat without having to su in? So basically I want to create a profile that has root privileges. Would it be something like: adduser someName ...how do I address the root privileges?

Thanks!
redgorilla2Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

owensleftfootCommented:
After you have created your friends username, edit /etc/passwd and change his uid to 0.
0
mbarbosCommented:
gid also...
0
redgorilla2Author Commented:
I changed it to the following

userName:x:0:0

but then upon logging in again, apparently the previous password is no longer valid (after trying both the orinigal user profile password and the root password). Why is that and how do I fix it? Thanks.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

GnsCommented:
Um, I hope that isn't the complete pwentry...:-)

It should work. I've just tested it on a RH8 box with shadow passwords (like you seem to be using)... works like a charm.
Not that I'd recommend this setup. root priveledges should be "cumbersome" to get;-). In most cases sudo is very much to be preferred.

Some systems might have a problem with /bin/login though.

If he really wants to run as root, well then ... have him run as root instead.

-- Glenn
0
GnsCommented:
One problem with "multiple users with the same UID" is that when you are logged in as that user and change the password, you will change the apssword for the first occurence of the _UID_, unless you do "passwd <username>" of course.
I would guess that you either "damaged" the passwd-file entry for the user, or you first edited him/her to be "secondary root" and the su'd to userName and changed the password (on the wrong account).

this is just one reason to not have multiple users (or username handles) for the same UID.

-- Glenn
0
haydes007Commented:
you could try sudo
0
redgorilla2Author Commented:

I think your right about damaging the password. I think that's what happened.

What is the difference between logging in directly as root and su'ing in?


Isn't running sudo the same as having the ability to su in? I can run root commands from the command line with either one, right?
0
redgorilla2Author Commented:

I think your right about damaging the password. I think that's what happened.

What is the difference between logging in directly as root and su'ing in?


Isn't running sudo the same as having the ability to su in? I can run root commands from the command line with either one, right?
0
GnsCommented:
The difference is in what files get read at shell startup, mostly (this is an oversimplification:-).
If you do just "su<Enter>", the environment of the user su is executed from will be more or less preserved. If you do "su - <user>" su will fake a login (and read profile etc). This is not only true for su'ing to root, but to any user.

There seem to be so little difference between sudo and su, but they are eons apart.
sudo is a way to give root privs without disclosing the root password... and keep some control on exactly what the "sudoer" is allowed to do.
sudo will ask for the users password and "cache" this authentication for a short while (default behaviour, you can change how it works in /etc/sudoers).
Read
man sudo sudoers visudo

Q&D:
just copy the line for root in /etc/sudoers and change the name to the intended "rootpriv" username.
example:
# User privilege specification
root    ALL=(ALL) ALL
glenn   ALL=(ALL) ALL

-- Glenn
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
redgorilla2Author Commented:
Thanks Gns! You helped me a lot!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.