LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Logging In as root (https://www.linuxquestions.org/questions/linux-newbie-8/logging-in-as-root-74734/)

DiabloDan 07-21-2003 10:21 PM

Logging In as root
 
what do you type in while your in a terminal to get root privileges?

dhoff 07-21-2003 10:43 PM

If you are waiting at a login prompt then type in root. It will then ask for a password. I think that you probably mean when you are already logged in as Joe User and want to do something as root.


Type in su (this is the switch user command)
it will ask for a password

and there ya go! You are now root.

lfur 07-22-2003 02:41 AM

DiabloDan,

you could also use:
su -

which takes you to the root home dir (just like you would login as root), and, IMHO very useful option,
su -c 'command'

which will prompt you for the password and execute the desired command with root privileges.

Enjoy

bigjohn 07-22-2003 02:54 AM

DiabloDan,

It looks like you have the mandrake 9.1 default set.

If you want to do command line stuff, then just open a terminal and type the "su" command then put in your root password (as mentioned in the others posts) - you will see the change in the prompt.

If on the other hand, you want to do stuff in gui mode, then you will probably have the default set up where root is a hidden user - not a problem, but to "unhide" root for graphic login,


log in as your user, and presuming that you are using KDE for your desktop, then "K"menu>configuration>control centre (kde control centre, not mandrake control centre)

once the control centre is open, system>login manager. To unhide root, at the bottom of the login manager dialogue click on the "administrator mode" button, when it has finished loading, un check the box for root being a hidden user (you should only then have "nobody" left checked as a hidden user I presume that you could delete nobody if you want, but I havent tried that!) then close the control centre.

You should now have root showing as a login option when you are logging in or changing login from the "K" menu.

regards

John:)

DiabloDan 07-22-2003 01:36 PM

ok thanks thats whaty i wanted to know i kindof blanked out and forgot what to do

bluethundr 07-22-2003 02:52 PM

Also, as one more option, if you only want to run one command and not leave yourself logged in as root for a long time (which can be a security hazzard) you can type in 'sudo command' command being whatever command you may want to issue. You will then be prompted for the root password.

mrGee 07-22-2003 03:00 PM

Hi

Yes bluethundr is right about sudo, it is quite handy, but
you might have to edit the /etc/sudoers to add the wanted
commands and/or users.
man sudoers will give you some info on that

good luck


All times are GMT -5. The time now is 10:42 PM.