Link to home
Start Free TrialLog in
Avatar of redgorilla2
redgorilla2

asked on

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!
Avatar of owensleftfoot
owensleftfoot

After you have created your friends username, edit /etc/passwd and change his uid to 0.
gid also...
Avatar of redgorilla2

ASKER

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.
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
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
you could try sudo

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?

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?
ASKER CERTIFIED SOLUTION
Avatar of Gns
Gns

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks Gns! You helped me a lot!