LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-11-2010, 01:03 AM   #1
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 610

Rep: Reputation: 31
How to switch to root account ?


Hi
I want to add a new user. For that purposeI switch to su and give root passwd. There I gave a command " useradd ".
[smith@localhost smith]#adduser

when i press enter key by typing adduser command it say me "Command not found" .Then i log off from my own account and login again from root account. The command "useradd" is then accepted.

Please guide me that is there any way that without logging off from normal user account I may enter my roor accout and work as a root account instead to log off from normal user account.

Thanks
garden

Last edited by gardenair; 03-11-2010 at 01:05 AM.
 
Old 03-11-2010, 01:16 AM   #2
sohail0399
Member
 
Registered: Oct 2008
Location: Pakistan, Islamabad
Distribution: CentOS, Fedora, Solaris
Posts: 154

Rep: Reputation: 23
for this you have to give the user admin rights.

for complete admin user equivalent as root you can do this

as root type command visudo for

remove # at line

## Same thing without a password
%wheel ALL=(ALL) NOPASSWD: ALL

save the file.

then modify user and add the user in group wheel
usermod -G wheel <user_name>

after this you can exicute root commands with sudo at start
sudo useradd <username>

if you want to give only adduser access to speicfic user than you have to see:
According to your requirments
http://linux.die.net/man/5/sudoers


for Solaris you have to study RBAC (roll bases access control)
 
1 members found this post helpful.
Old 03-11-2010, 01:32 AM   #3
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 610

Original Poster
Rep: Reputation: 31
thanks for the prompt reply .I am using Red Hat linux 9 in my home pc . Well as u mention in your post about sudo is it a valid RH command or it is used in Ubuntu ?
Please just guide me more.
 
Old 03-11-2010, 01:43 AM   #4
raju.mopidevi
Senior Member
 
Registered: Jan 2009
Location: vijayawada, India
Distribution: openSUSE 11.2, Ubuntu 9.0.4
Posts: 1,155
Blog Entries: 12

Rep: Reputation: 92
run "su" command to work as a root.
 
Old 03-11-2010, 01:51 AM   #5
sohail0399
Member
 
Registered: Oct 2008
Location: Pakistan, Islamabad
Distribution: CentOS, Fedora, Solaris
Posts: 154

Rep: Reputation: 23
yes, I am using CentOS its free but same like as RH. its work fine for it.
given above like in my post is also very important for details.

this is also important because you dont need to always login as root.
if someone gets access your root it can do any thing.
 
Old 03-11-2010, 01:58 AM   #6
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 610

Original Poster
Rep: Reputation: 31
thanks sohail0399 a lot for sharing your knowledge. Well is there any other site where I can get knowledge from such kind of tricks in linux.
appriciate your help.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
root account or user account arodlinux SUSE / openSUSE 3 12-23-2008 09:59 PM
Why is my common account can't open Terminal in XFCE4 but root account? notsay Slackware 4 08-19-2007 12:29 AM
Identifying non-administrators w/ root privilege/ Multiple root account in use wjeanpaul Linux - Security 4 05-19-2006 09:55 PM
is it legitimate and allowed and can be done to make another user account set uid and gid to null 0 to make another root account with different name and possibly not damage the debian system creating and using that new account BenJoBoy Linux - Newbie 12 01-29-2006 11:02 AM
How do I retain the PATH in the root account even when I switch to root using su? thearchitect Linux - Newbie 1 08-13-2005 01:02 AM


All times are GMT -5. The time now is 11:44 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration