LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How to create a user in linux with admin rights. (https://www.linuxquestions.org/questions/linux-general-1/how-to-create-a-user-in-linux-with-admin-rights-909110/)

ckiran04 10-20-2011 02:28 AM

How to create a user in linux with admin rights.
 
How to create a user in linux with admin rights. i have tried to create a sudo user.but i t not meets my requirement.. Please some one give me solution

fukawi1 10-20-2011 02:33 AM

What are your requirements, and why doesn't sudo meet them?

ckiran04 10-20-2011 03:11 AM

Sudo is just for switching from user to root. but i want a user to access total file system not as a root

fukawi1 10-20-2011 03:23 AM

Quote:

Originally Posted by ckiran04 (Post 4503216)
Sudo is just for switching from user to root.

I see you have done your homework on this one...
Sudo is for executing a command as another user. Most commonly, root. "man sudo".

The best solution i can think of, would be to add $username to the root group. Which isnt going to work for anything that has x00 permissions

Why are you trying to achieve this? Giving an unprivileged user "full" filesystem access, defeats the point of having a super user in the first place.

ckiran04 10-20-2011 05:41 AM

Is it possible to give access on whole file system, user should have only read permission .

fukawi2 10-20-2011 05:50 AM

What can't you access as a normal user that you think you should be able to?

SharpyWarpy 10-22-2011 09:59 PM

Well, I see the OP didn't get a straight answer so here you go. As root edit /etc/passwd. Find the line with the user name you want to use with root privileges. Change it thusly:

username:x:0:0:root:/home/username:/bin/bash

Notice I've substituted whatever user name you want with "username". Notice also the home directory. It is /home/username. Use whatever directory your user name in place of "username" there. This will give that user name root privileges. Oh, and you have to reboot. Or just log out and log back in as that user. Let us know if you have any problems.

fukawi1 10-22-2011 10:26 PM

How does this,
Quote:

Originally Posted by SharpyWarpy (Post 4505559)
As root edit /etc/passwd. Find the line with the user name you want to use with root privileges. Change it thusly:
username:x:0:0:root:/home/username:/bin/bash

Do that?
Quote:

Is it possible to give access on whole file system, user should have only read permission .

jefro 10-23-2011 12:13 PM

Depends on the distro. By security features some do not allow a root user to log on. It is pretty foolish to allow or use a root account from log on.

If you insist then use su and not sudo.

su is switch user. It can be any user. su mark or su root or such. Your admin account may not be root in fact.

sudo is to do a task as root.

It is really a poor practice to use su to root. Any time you are on that account, any other malware can run. sudo limits that greatly.

TobiSGD 10-23-2011 12:20 PM

Quote:

Originally Posted by jefro (Post 4505903)
It is really a poor practice to use su to root. Any time you are on that account, any other malware can run. sudo limits that greatly.

Sorry I have to say that, but that is totally nonsense. It is in no way poor practice to use su to become root, that is what it is intended for. And if you use su to root in a terminal, how should any other malware run as root because of that?

John VV 10-23-2011 01:04 PM

in a multi user office using "su -" is not a good idea for EVERYONE to use ( you have to give out the root pass to MANY people - not good)
sudo is a better choice

but
a single user or when there is only one Admin
then su - is a good choice

use the best set up for the situation

also no other user should be set up as a second root

there is a reason this is not set up by default .

SharpyWarpy 10-23-2011 07:02 PM

Quote:

Originally Posted by fukawi1 (Post 4505566)
How does this,

Do that?

It does not. You are right, I was wrong.

SharpyWarpy 10-23-2011 07:06 PM

Quote:

Originally Posted by TobiSGD (Post 4505906)
Sorry I have to say that, but that is totally nonsense. It is in no way poor practice to use su to become root, that is what it is intended for. And if you use su to root in a terminal, how should any other malware run as root because of that?

I'd like to know too, how malware can run if running as root. I have a single user system and I've been running with root privileges since 2002.

Knightron 10-23-2011 09:51 PM

Quote:

Originally Posted by SharpyWarpy (Post 4506134)
I'd like to know too, how malware can run if running as root. I have a single user system and I've been running with root privileges since 2002.

just to get things clear, do you mean you run all the time with root privleges? or that you just use su all the time when you need to perform a roof task in the terminal?

jefro 10-24-2011 03:54 PM

Linux best practices are not nonsense. You can do what you want but anytime a user is logged on a su there is a chance of malware or other attacks even if you don't believe in it.


All times are GMT -5. The time now is 04:01 AM.