LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Root Logins are not allowed (https://www.linuxquestions.org/questions/debian-26/root-logins-are-not-allowed-264279/)

martincho 12-08-2004 10:21 PM

Root Logins are not allowed
 
Hello All,

After install kde themes (kdeartwork and all the stuff needed) can't start kdm nor gdm.
Had to go to /etc/kde3 and run kdm.
Nice presentation and nice icons......but now only can login as user and can't log as root.
The message that I get when try to log as root is: " Root Logins are not allowed"
Anyway can run commands as root typing "su" and giving the root password.

I know that in this way it is safer but would like to know how to return to previous situation.....login as root.......and come back to this

Best Regards
Martin

student04 12-09-2004 01:32 AM

If you were in Mandrake Linux I would be able to tell you the way to do it immediately. But Debain does not have the Mandrake Control Center.

Maybe I can find something on google.... stay tuned. :)

---- Edit ----
And I did! Here is the link to it. Find the location of a file called kdmrc probably the easiest way would be
Code:

$ locate kdmrc
Mine is located in /usr/share/config/kdm/ . Here is my file:
Code:

[root@localhost kdm]# cat kdmrc
[General]
ConfigVersion=2.1
PidFile=/var/run/xdm.pid
Xservers=/etc/X11/xdm/Xservers

[Shutdown]
HaltCmd=/sbin/halt
LiloCmd=/sbin/lilo
LiloMap=/boot/map
RebootCmd=/sbin/reboot
UseLilo=true

[X-*-Core]
AllowNullPasswd=false
AllowRootLogin=false
AllowShutdown=Root
AutoReLogin=false
Reset=/etc/X11/xdm/GiveConsole
Resources=/etc/X11/xdm/Xresources
Session=/etc/X11/xdm/Xsession
Setup=/etc/X11/xdm/Xsetup_0
Startup=/etc/X11/xdm/TakeConsole
SystemPath=/usr/bin:/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/X11R6/bin/
UserPath=/usr/bin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin/

[X-*-Greeter]
AntiAliasing=true
AuthComplain=false
ColorScheme=Plastik
DefaultUser=alex
EchoMode=NoEcho
FaceSource=AdminOnly
FailFont=Sans,12,-1,5,75,0,0,0,0,0
FocusPasswd=false
ForgingSeed=1069108915
GUIStyle=dotNET
GreetFont=Sans,24,-1,5,50,0,0,0,0,0
GreetString=Welcome to %n
GreeterPosFixed=false
GreeterPosX=0
GreeterPosY=0
HiddenUsers=nobody,root
Language=en_US
LogoArea=Clock
LogoPixmap=
MaxShowUID=65535
MinShowUID=500
PreselectUser=None
SelectedUsers=
ShowUsers=None
SortUsers=true
StdFont=Sans,12,-1,5,50,0,0,0,0,0
UseBackground=true

[X-:*-Core]
AllowNullPasswd=true
AllowRootLogin=true
AllowShutdown=None
NoPassEnable=false
NoPassUsers=

[X-:*-Greeter]
LoginMode=DefaultLocal

[X-:0-Core]
Authorize=true
AutoLoginEnable=false
AutoLoginUser=alex

[X-:1-Core]
Authorize=true

[Xdmcp]
Enable=false
Willing=/etc/X11/xdm/Xwilling
Xaccess=/etc/X11/xdm/Xaccess

Have a look what I made bold. Modifying that value should allow for root login. Of course save the file, and restart the window manager. Let me know if this resolved the problem :)

Oliv' 12-09-2004 07:13 AM

Hi,

Check that you don't have a file called /etc/nologin... if yes, remove it

Oliv'

McCloud 12-09-2004 10:16 AM

Please, do NOT login as root. When you setup your machine correctly you don't need to have root access in KDE. Linux is NOT Windows.

And whenever you need root access, open a shell and do "su root" (For instance when you need to install applications or when you need to configure something). And whenever you need root access in a graphical application, use 'kdesu' to start it.

When I first started using Linux I also used to login as root. But it's just plain stupid, insecure and absolutely not necessary.

Good luck (and please, do not login as root ;) )

jonr 12-09-2004 10:44 AM

Quote:

Originally posted by McCloud
Please, do NOT login as root. [...]

Good luck (and please, do not login as root ;) )

I second that motion!

Actually, if you get used to it, you'll likely enjoy a non-graphical login much more than
the graphical thing, which just frustrates me. Sometimes there's a little routine maintenance
or something I want to check from the command line before actually logging in, and
the command-line login makes that a snap, where the graphical one makes it impossible.

To switch to a command-line login you just change the default runlevel from "5" to "3"
in /etc/inittab.

Just my two cents' worth on this issue.

TigerOC 12-09-2004 11:43 AM

If you want to work on files via root then use the file manager. In my system using kde its K -> system -> more programs -> file manager it will then ask for you root password.

Wells 12-09-2004 11:57 AM

Quote:

Originally posted by jonr

To switch to a command-line login you just change the default runlevel from "5" to "3"
in /etc/inittab.


This is a Redhat/Mandrake-centric viewpoint when it comes to runlevels. The default runlevel in debian is typically runlevel 2 in the first place. In order to remove the graphical login within debian, all you need to do is remove the symbolic link to gdm in /etc/rc2.d, typically S99gdm.

martincho 12-09-2004 10:31 PM

Hey!

Many thanks to all of you for your replies, are quite interesting and usefull.

First of all, Student04: yes, it works with your advice. It is just what I wanted.

2- McCloud & Jonr: Thanks a lot for your recommendation, I agree with you since read somewhere that connected while logged as root give the chance to anyone modify your system if can access. Agree also that Linux is not Windows......that is the main reason why I want to learn, and indeed I do...now I know how can allow/deny "root logins":)

3- TigerOC, Wells & Oliv': Thanks a lot for your comments, will take them into account (in fact I'm saving the page)

Regards
Martin

aikidoist72 01-30-2005 06:26 PM

Hi Guys,

Great article, and very helpful!!!!!!!!!!!!!!!!!!!

TigerOC - the only reason I have ever logged into root was for this graphical interface, excellent advice thankyou!


McCloud - I tried your suggestion and recieved this:-


evoffice:/# kdesu
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

kdesu: cannot connect to X server :0.0
evoffice:/#


Any idea's? I have not got my Samba setup properly, but I not sure if this is linked.


Also, if I wanted to edit a file in command line, how do I go about it. The only reference to this type of command is for dos. I don't want to be stuck to a graphical interface, as I see the power of the command line.

Cheers

Evan

foamrotreturns 01-30-2005 06:48 PM

Quote:

Originally posted by aikidoist72

Also, if I wanted to edit a file in command line, how do I go about it. The only reference to this type of command is for dos. I don't want to be stuck to a graphical interface, as I see the power of the command line.

Cheers

Evan

Don't know how to answer your first question - this thread was the first I ever heard of the kdesu command as well. The kdesu --help command didn't give me much information either and there is no man page for it.
As to your second question, there are a few good command line editors for ascii files. one is "vi" which is called like this:
vi <filename>
this will take you into viewing the file mode. if you want to edit it, hit the "I" key. This is insert mode. Edit the text the way you want to. To get out of insert mode, hit escape. Then, to save, make a colon, and type the letter "w" for "write." If you want to save and exit, just throw in a "q" at the end to look like this: ":wq"
Those are the basic commands for vi.
you can also use joe. joe is called like this:
joe <filename>
joe has a very detailed list of commands in it, so explaining them here would be unnecessary. Joe greatly resembles old-skool DOS WordPerfect. If you miss the glory days, head over into joe and have a look around. :)

student04 01-30-2005 06:55 PM

Quote:

Originally posted by aikidoist72
Also, if I wanted to edit a file in command line, how do I go about it. The only reference to this type of command is for dos. I don't want to be stuck to a graphical interface, as I see the power of the command line.
You can use "vi" or "vim" or "nano" or "pico". For example
Code:

# vim /etc/inittab
would open up the vim editor with the /etc/inittab file loaded. I would recommend that you try pico or nano first as they are more straight forward with usage, but vi/vim is more powerful (do some reading on the net first).

*edit*
darn someone posted before me... :(


All times are GMT -5. The time now is 09:51 PM.