?
Solved

root privileges ....

Posted on 2003-03-31
10
Medium Priority
?
818 Views
Last Modified: 2010-04-20
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!
0
Comment
Question by:redgorilla2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 17

Expert Comment

by:owensleftfoot
ID: 8241552
After you have created your friends username, edit /etc/passwd and change his uid to 0.
0
 
LVL 6

Expert Comment

by:mbarbos
ID: 8241718
gid also...
0
 

Author Comment

by:redgorilla2
ID: 8242097
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
Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

 
LVL 20

Expert Comment

by:Gns
ID: 8244963
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
 
LVL 20

Expert Comment

by:Gns
ID: 8245028
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
 
LVL 2

Expert Comment

by:haydes007
ID: 8248162
you could try sudo
0
 

Author Comment

by:redgorilla2
ID: 8249787

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
 

Author Comment

by:redgorilla2
ID: 8249803

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
 
LVL 20

Accepted Solution

by:
Gns earned 300 total points
ID: 8252261
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
 

Author Comment

by:redgorilla2
ID: 8271542
Thanks Gns! You helped me a lot!
0

Featured Post

How To Reduce Deployment Times With Pre-Baked AMIs

Even if we can't include all the files in the base image, we can sometimes include some of the larger files that we would otherwise have to download, and we can also sometimes remove the most time-consuming steps. This can help a lot with reducing deployment times.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses
Course of the Month9 days, 4 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question