LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 10-20-2011, 03:28 AM   #1
ckiran04
LQ Newbie
 
Registered: Apr 2008
Posts: 21

Rep: Reputation: 0
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
 
Old 10-20-2011, 03:33 AM   #2
fukawi1
Member
 
Registered: Apr 2009
Location: Melbourne
Distribution: Fedora & CentOS
Posts: 854

Rep: Reputation: 189Reputation: 189
What are your requirements, and why doesn't sudo meet them?
 
Old 10-20-2011, 04:11 AM   #3
ckiran04
LQ Newbie
 
Registered: Apr 2008
Posts: 21

Original Poster
Rep: Reputation: 0
Sudo is just for switching from user to root. but i want a user to access total file system not as a root
 
0 members found this post helpful.
Old 10-20-2011, 04:23 AM   #4
fukawi1
Member
 
Registered: Apr 2009
Location: Melbourne
Distribution: Fedora & CentOS
Posts: 854

Rep: Reputation: 189Reputation: 189
Quote:
Originally Posted by ckiran04 View Post
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.
 
Old 10-20-2011, 06:41 AM   #5
ckiran04
LQ Newbie
 
Registered: Apr 2008
Posts: 21

Original Poster
Rep: Reputation: 0
Is it possible to give access on whole file system, user should have only read permission .
 
Old 10-20-2011, 06:50 AM   #6
fukawi2
Member
 
Registered: Oct 2006
Location: Melbourne, Australia
Distribution: ArchLinux, ArchServer, Fedora, CentOS
Posts: 448

Rep: Reputation: 34
What can't you access as a normal user that you think you should be able to?
 
1 members found this post helpful.
Old 10-22-2011, 10:59 PM   #7
SharpyWarpy
Member
 
Registered: Feb 2003
Location: Florida
Distribution: Fedora 18
Posts: 862

Rep: Reputation: 90
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.
 
0 members found this post helpful.
Old 10-22-2011, 11:26 PM   #8
fukawi1
Member
 
Registered: Apr 2009
Location: Melbourne
Distribution: Fedora & CentOS
Posts: 854

Rep: Reputation: 189Reputation: 189
How does this,
Quote:
Originally Posted by SharpyWarpy View Post
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 .
 
Old 10-23-2011, 01:13 PM   #9
jefro
Guru
 
Registered: Mar 2008
Posts: 12,087

Rep: Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521
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.

Last edited by jefro; 10-23-2011 at 01:17 PM.
 
Old 10-23-2011, 01:20 PM   #10
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,653
Blog Entries: 2

Rep: Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095
Quote:
Originally Posted by jefro View Post
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?
 
2 members found this post helpful.
Old 10-23-2011, 02:04 PM   #11
John VV
Guru
 
Registered: Aug 2005
Posts: 13,508

Rep: Reputation: 1804Reputation: 1804Reputation: 1804Reputation: 1804Reputation: 1804Reputation: 1804Reputation: 1804Reputation: 1804Reputation: 1804Reputation: 1804Reputation: 1804
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 .
 
Old 10-23-2011, 08:02 PM   #12
SharpyWarpy
Member
 
Registered: Feb 2003
Location: Florida
Distribution: Fedora 18
Posts: 862

Rep: Reputation: 90
Quote:
Originally Posted by fukawi1 View Post
How does this,

Do that?
It does not. You are right, I was wrong.
 
Old 10-23-2011, 08:06 PM   #13
SharpyWarpy
Member
 
Registered: Feb 2003
Location: Florida
Distribution: Fedora 18
Posts: 862

Rep: Reputation: 90
Quote:
Originally Posted by TobiSGD View Post
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.
 
Old 10-23-2011, 10:51 PM   #14
Knightron
Senior Member
 
Registered: Jan 2011
Location: Planet Earth
Distribution: Slackware.
Posts: 1,344
Blog Entries: 7

Rep: Reputation: 159Reputation: 159
Quote:
Originally Posted by SharpyWarpy View Post
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?
 
Old 10-24-2011, 04:54 PM   #15
jefro
Guru
 
Registered: Mar 2008
Posts: 12,087

Rep: Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to give full admin rights to the new user chethankp Linux - Newbie 3 07-15-2011 05:26 PM
C++ codes to check whether user is root or has admin rights in Linux cshong Programming 4 01-08-2011 02:01 PM
LINUX SAMBA SERVER - Temporary domain admin rights for network windows client user. jcdole Linux - Server 0 01-07-2008 03:44 PM
How to add user with admin rights or root previliges? tsarlz Fedora 1 10-24-2006 09:05 AM
Linux PDC - How Do I give the Samba User Local Admin Rights on XP machine? Vince0000 Linux - Networking 4 12-18-2003 03:54 AM


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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration