LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 11-04-2008, 03:35 AM   #1
galapogos
Member
 
Registered: May 2008
Posts: 227

Rep: Reputation: 30
How to login as root on Mandrake 9.1?


Hi,

I just installed Mandrake 9.1(yes I know it's old but I need something with kernel 2.4 for personal reasons) and I accidentally checked the auto-login box during the installation and not it always logs me into my default user account. I need to find out how to login as root instead?

I've tried booting up into linux-nonfb and then logging in as root and that works, but when I try to startx it gives me an error and bombs out back into the shell.

How to disable the auto-login, or have the auto-login log me in as root instead?

Thanks!
 
Old 11-04-2008, 04:15 AM   #2
Agrouf
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,596

Rep: Reputation: 80
you want to log in graphical mode as root? This is a really bad idea if you ask me. Why would you want to do that?
 
Old 11-04-2008, 05:30 AM   #3
webquinty
Member
 
Registered: Apr 2008
Location: España
Distribution: Suse
Posts: 227

Rep: Reputation: 32
Nomally, if you want to do something as root, go to console and execute a order with sudo command.

Other option, in console, you can type "su" and password, and you will be in root mode until close console.

Notice that it is very dangerous if you do not known what are you doing.

Best regards
 
Old 11-04-2008, 07:55 AM   #4
galapogos
Member
 
Registered: May 2008
Posts: 227

Original Poster
Rep: Reputation: 30
Thanks for the warning. This is a development PC where so I'll need to be logged in as root. I don't wish to su/sudo every time I run a new console. So, I need to be logged in as root. Can anyone please answer the question? Thank you.
 
Old 11-04-2008, 08:14 AM   #5
Agrouf
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,596

Rep: Reputation: 80
in /etc/kde3/kdm/kdmrc, allow root login (set to TRUE). This is still a bad idea anyway. What is the point of having a root user if you are logged as root by default? Just chmod -R 777 /* then. I really don't get why you want to do that, but anyway it's your computer...

Last edited by Agrouf; 11-04-2008 at 08:17 AM.
 
Old 11-04-2008, 08:57 AM   #6
galapogos
Member
 
Registered: May 2008
Posts: 227

Original Poster
Rep: Reputation: 30
Thank you. I will try that.
 
Old 11-04-2008, 09:31 AM   #7
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
He just said it was a development computer. I do the same thing on my development target systems; it is just a lot easier to be root when you are doing development things (device level, kernel level, module level - not user level - development). You need the access anyway and typing sudo all the time is a royal PITA.

When you are doing this kind of work, the machine is not in production and ordinarily won't be surfing the web (though it might be going out on the internet). So telling him how he OUGHT to be doing it is counterproductive; he has good reasons for being root all the time just as I have good reasons for being root all the time on my target systems.

Generally, though, I run my target systems headless and ssh into them, then su to root once I am there. Then, as required, I forward X sessions to my workstation (where I am NOT root), or do whatever else is required.
 
Old 11-04-2008, 09:41 AM   #8
john test
Member
 
Registered: Jul 2008
Distribution: ubuntu 9.10
Posts: 527
Blog Entries: 1

Rep: Reputation: 35
Code:
$ sudo passwd root
Give it the same password that you use when you log in.
Once you have set a password for root, then go to the command line and type "su" it will ask you for the password and once done, the prompt will change from $ to # and you will be Root until you power down or type "exit" at the # prompt.
Good luck with it.
 
Old 11-04-2008, 09:53 AM   #9
Agrouf
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,596

Rep: Reputation: 80
Many programs won't work just because they are launched as root, and they shouldn't. Only ubuntu doesn't have a root and you don't have to type sudo everytime when you are logged as root. You can have a konsole logged as root (I do that with a red background to remind me that I'm logged as root - even on my development machine). It's not just about security. Many programs just don't work when you are logged as root. KDM doesn't allow you to log as root by default, you have to edit a configuration file for that. And then, many things just won't work. This is for a reason. You are going to run into a lot of problems if you launch X from root.
Anyway, I still see no reason to do that. Just add the konsole to the sudoers file with no password and you don't have to type the root password everytime to launch it as root. This is way less troubles that setting every applications (starting from the X server itself) to run as root in my opinion.
Anyway, this is just my opinion and it is your computer. If you think it is better for you then o it.
 
Old 11-04-2008, 09:55 AM   #10
Agrouf
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,596

Rep: Reputation: 80
Quote:
Originally Posted by john test View Post
Code:
$ sudo passwd root
Give it the same password that you use when you log in.
Once you have set a password for root, then go to the command line and type "su" it will ask you for the password and once done, the prompt will change from $ to # and you will be Root until you power down or type "exit" at the # prompt.
Good luck with it.
This is not Ubuntu!
 
Old 11-04-2008, 08:59 PM   #11
galapogos
Member
 
Registered: May 2008
Posts: 227

Original Poster
Rep: Reputation: 30
OK I modified kdmrc(which is actually in /usr/share/config/kdm) to allow root login as well as unhide the root user. However the automatic login is still there. I'm able to logout and then relogin back as root, but how do I get rid of the autologin?

Thanks.
 
Old 11-04-2008, 09:06 PM   #12
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Quote:
Originally Posted by galapogos View Post
Thanks for the warning. This is a development PC where so I'll need to be logged in as root. I don't wish to su/sudo every time I run a new console. So, I need to be logged in as root. Can anyone please answer the question? Thank you.
You are free to do whatever you want, of course.

But there's absolutely nothing in that post that is a true reason to run as root. Root has nothing to do with developing software, root is meant only for administrative stuff, like configuring your system, adding or deleting users, installing software, etc. You don't need to be root to develop.

PS: Indeed, that it's a machine meant for developing (a serious use, I assume) is yet another reason to take care and use it correctly, and that includes using root only when strictly needed. Every user should run always only with the minimal privileges that are enough to fulfill his work, and nothing else. To run with more privileges that those that you need is to run useless risks without any reason.

And definitely, running X apps as root is never a good idea, and a thing that I always advise against. A misclick can render your install useless forever.

PS(2): kernel development is not an excuse either. You only need the elevation of privileges to do make install modules_install, everything else is doable as a regular user. A couple of alias and sudo can sort that so you can install the kernel with typing a single character if that's the problem.

Last edited by i92guboj; 11-04-2008 at 09:16 PM.
 
Old 11-05-2008, 12:57 AM   #13
Agrouf
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,596

Rep: Reputation: 80
Quote:
Originally Posted by galapogos View Post
OK I modified kdmrc(which is actually in /usr/share/config/kdm) to allow root login as well as unhide the root user. However the automatic login is still there. I'm able to logout and then relogin back as root, but how do I get rid of the autologin?

Thanks.
In the same config file, there should be something like auto-login.
You can also disable it by holding the shift key just when X starts.
 
  


Reply



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
how to login as root in MAndrake 10.1 gjo Linux - General 6 06-12-2005 01:45 PM
Login as ROOT mandrake 10 virtthemaest Linux - Newbie 8 09-16-2004 08:20 AM
How to Login as Root (Mandrake 10) Almazick Linux - Newbie 2 09-03-2004 02:47 AM
Cannot login as root on mandrake 9.2 mrsteve Mandriva 1 02-27-2004 02:30 AM
Mandrake 9 - Login as Root? Planky Linux - Software 2 08-16-2003 07:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:14 PM.

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
Open Source Consulting | Domain Registration