LinuxQuestions.org
Register a domain and help support LQ
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 10-05-2013, 08:10 PM   #1
jlpeng
LQ Newbie
 
Registered: Oct 2013
Posts: 1

Rep: Reputation: Disabled
switch to root user


Hi,

I am starting to learn linux operation system and want to know how to change to root account after logged in.

Thanks!

Jianling
 
Old 10-05-2013, 08:38 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,275

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
Depending on how your distribution is set up, either "su" or "sudo" are generally used.
 
Old 10-05-2013, 08:45 PM   #3
ozar
Member
 
Registered: May 2004
Location: USA
Distribution: Arch Linux
Posts: 415

Rep: Reputation: 82
Hello

Checking the manual page for each command will give you some details on their usage. You can check their man pages as follows:

man su

man sudo
 
Old 10-05-2013, 09:04 PM   #4
officerx
Member
 
Registered: Sep 2013
Distribution: centOS, backtrack linux R3, windows 7
Posts: 59

Rep: Reputation: Disabled
Word of advice:

Be careful when typing in commands under root. Cause the damages could be permanent
 
Old 10-05-2013, 09:33 PM   #5
joe_2000
Member
 
Registered: Jul 2012
Location: Aachen, Germany
Distribution: Void, Debian
Posts: 808

Rep: Reputation: 216Reputation: 216Reputation: 216
Further to the previous replies it might be worth clarifying that some distros (e.g. Ubuntu, Mint) have the root account disabled by default. As a result, you cannot become root with the su command. You can however launch a root shell using
Code:
sudo -s
 
Old 10-06-2013, 02:59 AM   #6
SAbhi
Member
 
Registered: Aug 2009
Location: Bangaluru, India
Distribution: CentOS 6.5, SuSE SLED/ SLES 10.2 SP2 /11.2, Fedora 11/16
Posts: 664

Rep: Reputation: 80
Addtionally for some distros the very first user account has default access to "sudo" that can be used.

sudo
user's password
 
Old 10-06-2013, 10:58 PM   #7
graeyhat
Member
 
Registered: Oct 2013
Location: USA, a place where an open-source document (The Constitution) is the law of the land.
Distribution: Debian (because of their underlying philosophies) running AwesomeWM (because of its functionality).
Posts: 34

Rep: Reputation: Disabled
Depending on your distro (please note the use of absolute filepaths, it is good practice to use such):

/bin/sudo -i
(i as in interactive)

or

/bin/su -l
(l as in login)
 
Old 10-07-2013, 03:13 AM   #8
shiv garg
LQ Newbie
 
Registered: Sep 2013
Location: Amritsar
Distribution: fedora 19
Posts: 11

Rep: Reputation: Disabled
just go to terminal and type su
and then your password

you will be logged in as root user


but if you have not set the password for root user

then first set your password for root
 
  


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
switch to root user bdavide Linux - Newbie 14 05-20-2008 08:44 PM
How do I switch to root user binarybob0001 Programming 4 11-26-2007 04:26 AM
How do you switch to root user barrythai Ubuntu 19 04-13-2007 12:55 PM
How do I switch ROOT/ADMINISTRATOR to another user?? Balarabay1 Linux - Software 4 07-21-2006 04:54 AM
How switch root to another user? Xiangbuilder Linux - Newbie 1 09-15-2003 08:19 AM


All times are GMT -5. The time now is 02:09 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