LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 07-03-2007, 03:24 PM   #1
Greebstreebling
Member
 
Registered: Nov 2005
Location: Swansea, Wales, UK
Distribution: debian
Posts: 235

Rep: Reputation: 30
Smile KDE and root login


Dear folks - recently upgraded to Deb 4.0; great and made a financial contribution to the development of this nice OS.

I have recently started using kde and have got myself in a knot. I just have a desktop m/c runs openoffice and internet access. I need to login as root, but KDE doesn't allow this for some reason. I can't find out how to login as root to do some maintenance!

Do I need to shutdown kde to login? If so how do I do that please?

Is there a way to use KDE as root - I like the interface and just need to change my xconfig file to incorporate a new monitor I have.

Thanks for any help,
Greeb
 
Old 07-03-2007, 03:28 PM   #2
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 272Reputation: 272Reputation: 272
Debian disables root login by default. In the /etc/ directory there should be kdm's config file somewhere that you could probably enable it.

But the way you typically do this in debian is to use su or sudo (or gksudo) to perform tasks as root. So to edit your xconfig file, just do sudo kate /etc/X11/xorg.conf.
 
Old 07-03-2007, 03:47 PM   #3
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian 9 Stretch
Posts: 2,349
Blog Entries: 8

Rep: Reputation: 384Reputation: 384Reputation: 384Reputation: 384
If you're using kdm, then you can change whether root login is allowed within KDE's Control Center (down within System Administration). If you're using gdm, then you can configure whether gdm allows root login from within gdm (no need to log in as any user).

However, it's not a good idea to log in as root. In another discussion thread, apparently in Mandriva logging in as root can seriously mess up the other users. No idea whether this bug affects Debian also, but it's an example of the sort of bad thing that might happen if you log in as root into KDE.
 
Old 07-03-2007, 03:53 PM   #4
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,190

Rep: Reputation: 1037Reputation: 1037Reputation: 1037Reputation: 1037Reputation: 1037Reputation: 1037Reputation: 1037Reputation: 1037
Actually, I cannot imagine one single reason why to login into KDE as root. It is dangerous for more than one reason.

If you have to perform root tasks, either open a console and work in text mode. You can su or sudo.

Or press ALT-F2 to get a dialog where you can run a GUI application as a different user. (Press the options button)

Debian disables root login by default and that is a good idea. For the same reason SSH is disabled for root login. Safer workarounds are provided.

jlinkels
 
Old 07-03-2007, 04:08 PM   #5
Greebstreebling
Member
 
Registered: Nov 2005
Location: Swansea, Wales, UK
Distribution: debian
Posts: 235

Original Poster
Rep: Reputation: 30
Smile OK and thanks but...

O.K. Guys I get the picture, but my problem is when my m/c boots it runs up kde and I login there. If I use the kde menu to start a new session it presents me with KDE and a login box.

How do I get away from this?

I am just trying to edit an xconfig file to try to set up a flatscreen monitor (posted in hardware forum)

I tried sudo root etc/x11/filename but it refuses to accept my root password - I have never used sudo before and I think the user has to be part of the group - unsure of what to do once I get out of GUI mode (hate to say it but Windows lets you do these things in GUI)

Apologies for ignorance and mentioning windows
Greeb
 
Old 07-03-2007, 04:11 PM   #6
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian 9 Stretch
Posts: 2,349
Blog Entries: 8

Rep: Reputation: 384Reputation: 384Reputation: 384Reputation: 384
Quote:
Originally Posted by jlinkels
Debian disables root login by default and that is a good idea. For the same reason SSH is disabled for root login.
While I absolutely agree that it's a good idea to disable root login for SSH, for whatever reasons root login is enabled by default when you install openssh-server in Debian. Why? I have no idea. In any case, it's the first thing I change whenever I install openssh-server.
 
Old 07-03-2007, 04:22 PM   #7
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian 9 Stretch
Posts: 2,349
Blog Entries: 8

Rep: Reputation: 384Reputation: 384Reputation: 384Reputation: 384
Quote:
Originally Posted by Greebstreebling
I tried sudo root etc/x11/filename but it refuses to accept my root password - I have never used sudo before and I think the user has to be part of the group - unsure of what to do once I get out of GUI mode (hate to say it but Windows lets you do these things in GUI)
By default Debian 4.0 does install "sudo" in the base system, but it does NOT include any users other than root. If you're not familiar with how to configure or use "sudo", then there is NO NEED FOR YOU TO LEARN SUDO. Really--you don't need sudo.

Instead, you can use the standard *nix way of doing things, the "su" command. Basically, at a text shell you type in the command "su". It will ask you for the root's password. You can tell you're logged in as root because it uses a "#" prompt.

At that point, you can type in commands to do what you want. You COULD use a graphical text editor, but I'd recommend learning a plain text editor like "pico". You use pico with the command:

pico /etc/X11/xorg.conf

Note that you don't need to type in entire filenames--you can press <tab> at any time to autocomplete a partial filename.

The reason I suggest using a plain text editor is that it is by far the preferable way to mess around with xorg.conf. What happens if you make a mistake in xorg.conf? You're stuck in plain text mode with no GUI. Then you have to learn how to fix the darn thing the hard way anyway. Sure, you can tediously prepare backup copies and copy files around...but it's tedious and it'll make your head spin keeping track of it all.

By far the most pleasant way to mess with xorg.conf is to use ctrl-alt-f2 and ctrl-alt-f7 to switch between graphical mode and console mode. In console mode, you log in as root and modify /etc/X11/xorg.conf. In graphical mode, you use ctrl-alt-backspace to reset the X server.

If the X server fails, then things get a little more complicated. In that case, gdm will shut down. In order to get gdm living again, you COULD just restart the entire computer--but it takes a lot less time to use the following command to just restart gdm:

/etc/init.d/gdm restart

Is this all complicated? Yeah, sure it is. Unfortunately, when you mess with stuff that can blow up your GUI, you need to prepare for how to fix it without the GUI beforehand.
 
Old 07-03-2007, 04:23 PM   #8
Greebstreebling
Member
 
Registered: Nov 2005
Location: Swansea, Wales, UK
Distribution: debian
Posts: 235

Original Poster
Rep: Reputation: 30
How to get out of KDE to run as root then...

So without getting too techy how do I get to login as root please?

I guess I'll have to stop kde? If so how do I restart it afterwards when I wish to login as non root user.

Thanks
Greeb
 
Old 07-03-2007, 04:27 PM   #9
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian 9 Stretch
Posts: 2,349
Blog Entries: 8

Rep: Reputation: 384Reputation: 384Reputation: 384Reputation: 384
You don't need to stop KDE. Press ctrl-alt-f1. This will get you back to the bootup text console. Type in "root" for the username and then it will ask for a password (note that you receive no visual feedback when typing in the password--no asterisks).

To get back to GUI mode, you press ctrl-alt-f7. Then, you can reset the X server with ctrl-alt-backspace.

Note that if xorg.conf is messed up, then the X server may fail to start. Make a backup copy of your working xorg.conf before changing it!
 
Old 07-03-2007, 04:28 PM   #10
Greebstreebling
Member
 
Registered: Nov 2005
Location: Swansea, Wales, UK
Distribution: debian
Posts: 235

Original Poster
Rep: Reputation: 30
sorry posts crossed

Soory Isaackuo, our posts crossed - will give what you'v said a try - thank you for all the detail and time.

Greeb
 
Old 07-03-2007, 09:51 PM   #11
stlutz
LQ Newbie
 
Registered: Jan 2007
Posts: 2

Rep: Reputation: 0
You can edit the /etc/kde3/kdm/kdmrc file.
Change:

AllowRootLogin=false

To:

AllowRootLogin=true
 
Old 07-03-2007, 10:11 PM   #12
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
You can use kdesu to launch a GUI program as root. You can either enter "kdesu <program>" name in the panel's run command. Or the [alt]-[f1] shortcut, or enter "kdesu <program>" in konsole.

For example enter "kdesu kate /etc/X11/xorg.conf" to use kate as root to edit the xorg.conf file.

I don't run debian, but you can also launch the distro's gui config programs this way, even through an ssh tunnel.

For example, I can open a session from one laptop "hpamd64" (SuSE 10.2/Windows XP) to another "delllap" with the command "ssh -X delllap". Then I can use either "sudo /usr/sbin/system-config-services" and then enter my own password on the Fedora Core remote laptop (That's how they configure sudo), or I can enter "kdesu system-config-services". This time it's the kpassword program that initially pops up where I enter the root password. The second way, I wouldn't need to know the absolute path to the system-config-* programs.

I can do the on the rare events that I am booted to XP, since I have Cygwin/X installed. ( A rare event, indeed, usually to run security updates).
 
Old 07-04-2007, 03:40 PM   #13
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,190

Rep: Reputation: 1037Reputation: 1037Reputation: 1037Reputation: 1037Reputation: 1037Reputation: 1037Reputation: 1037Reputation: 1037
Quote:
Originally Posted by IsaacKuo
While I absolutely agree that it's a good idea to disable root login for SSH, for whatever reasons root login is enabled by default when you install openssh-server in Debian. Why? I have no idea. In any case, it's the first thing I change whenever I install openssh-server.
Yes, you are right. It is not disabled by default. But disabling root SSH is so extremely the first thing that I do after installing SSH that I forgot that it is enabled by default.

It should be part of the installation though. I run a few linux servers as firewalls, and I get scared as I see how many attacks on the root account are being performed.

jlinkels
 
Old 07-13-2007, 02:19 PM   #14
JohnE1
Member
 
Registered: Jun 2007
Location: Houston, TX
Distribution: Fedora, CentOS, Ubuntu
Posts: 66

Rep: Reputation: 16
Quote:
Originally Posted by IsaacKuo
By default Debian 4.0 does install "sudo" in the base system, but it does NOT include any users other than root. If you're not familiar with how to configure or use "sudo", then there is NO NEED FOR YOU TO LEARN SUDO. Really--you don't need sudo.

Instead, you can use the standard *nix way of doing things, the "su" command. Basically, at a text shell you type in the command "su". It will ask you for the root's password. You can tell you're logged in as root because it uses a "#" prompt.

> SNIP <
IMPORTANT NOTE:
---------------

I suggest you enter "su -", rather than just "su".

To see the diff, at a console prompt enter: man su

The most _important_ diff is that "su -" (with the dash argument) does a true login to root, which means that the all the config files normally read and executed if you were to login as 'root", will be loaded and executed.

The _result_ is that you run with root's path and environment variables, NOT with the path, environment variables, and other configuration settings of the user account where you ran "su".

Adding the dash option does a true root login, period.

One other thing to be aware of, just because you're at a console prompt, you're not limited to text-only programs.

Example #1:
-----------
In Red Hat, CentOS, and Red Hat-based distros, if you want to configure a printer and use a GUI interface, you can run the following at the console prompt:

system-config-printer-gui &

Example #2:
-----------
Temporarily access the internet to look something up, you can do the following:

firefox &

The ampersand (&) causes the program to run in the 'background' and returns control to the console. If you don't see a console prompt, hit <Enter> and you should get a console prompt. All the while, you're free to go use Firefox or configure a printer. The reason this works is because Xserver was started when you logged in and it's still running when you CTRL-Alt-F1 to a console window.

To see what jobs are running in the current shell (console) enter:

jobs

Hope you're not overloaded with too much info, but in time this will all make sense and seem elementary to you.

Regards,

JohnE1
 
Old 07-13-2007, 09:01 PM   #15
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 61
Lot's of bull flying around here.
Check post #3 to find how to allow root login in KDE in the thread link below.
http://www.linuxquestions.org/questi...d.php?t=558060
To disable the log in screen, go to main menu/settings/control_center/system_administrator/login_manager, then click at the bottom on "Administrator mode", type in the admin. password and click on the "Convenience" tab and put a (x) in the box "enable-auto-login" and select the user you want KDE to automatically log in to their desktop without the login screen.
 
  


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
login as root using kde Greebstreebling Linux - Newbie 4 06-01-2007 02:23 PM
root login via kde login screen linuxmandrake Linux - Newbie 2 10-09-2005 11:30 AM
KDE 3.4 no root login!? lefty.crupps SUSE / openSUSE 2 04-28-2005 03:47 AM
kde 3.3 no root login efi360 Linux - Software 9 01-15-2005 07:32 PM
KDE: cannot login as root claudiu_t Linux - General 1 01-26-2004 12:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

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