LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-26-2004, 12:16 PM   #1
ttilt
Member
 
Registered: Dec 2003
Location: Campinas, Brasil
Distribution: slackware 10
Posts: 150

Rep: Reputation: 15
emacs not running in a windows


i recently installed slackware but for some reason, when i run emacs under root, it doesn't open an X windows, it just opens in console mode. If I run as a regular user, it correctly opens a window.

Anyone knows what could be causing this?
 
Old 11-26-2004, 02:18 PM   #2
eelriver
Member
 
Registered: May 2004
Location: san francisco
Distribution: Slackware 10.2 kernel 2.6.13, Gentoo amd64, Some mish-mash of programs that started with slack 9.0
Posts: 165

Rep: Reputation: 30
The xserver is "bound" to the user that logged into it and won't run another instance for a new user by default.
 
Old 11-26-2004, 03:07 PM   #3
Pollyanna
Member
 
Registered: Oct 2003
Location: Germany
Distribution: Slackware 10.2, SuSE 10.0, Solaris(SPARC) 9+Solaris(x86) 9, NetBSD(sparc) 2.0.2
Posts: 43

Rep: Reputation: 15
Question $DISPLAY not set?

Hi,

how are you logged in as root?

If you choose the propper way, log in as mortal user at system start and then log in as "root" in a terminal window at your windowmanager session, it depends on *how* you log in.
If you "su -" or merly "su", you are "root" now but the envirenmet variable (DISPLAY) needet to start X-applications is not set at all.
The same problem occurs if you "telnet" to another machine.

This is the reason, I prefer SSH. If ssh and sshd are properly configured "DISPLAY" is automatically set up the right way and you can use *all* X-/KDE-/Gnome-/...-applications.
So I "ssh root@localhost" and that`s it. ;-)

The second benefit of SSH is in using public/private-key authorization. So I can log in to different machines, that have *different* username/passwords with *one* password that is protecting the private key on my local machine (or even without any password) and *still* am safe about encripted data and secure login. 8-)


Hopefully helpfull

Pollyanna
 
Old 11-26-2004, 05:08 PM   #4
eelriver
Member
 
Registered: May 2004
Location: san francisco
Distribution: Slackware 10.2 kernel 2.6.13, Gentoo amd64, Some mish-mash of programs that started with slack 9.0
Posts: 165

Rep: Reputation: 30
Pollyanna,
That's a good way to do it if your box isn't exposed to the outside at all but many of us like to be able to ssh from outside, and as a security measure disable root logins. If that's the case your method won't work.
 
Old 11-26-2004, 06:48 PM   #5
Pollyanna
Member
 
Registered: Oct 2003
Location: Germany
Distribution: Slackware 10.2, SuSE 10.0, Solaris(SPARC) 9+Solaris(x86) 9, NetBSD(sparc) 2.0.2
Posts: 43

Rep: Reputation: 15
Wink You are partially right

Hi,

I must admit, that you are in some respect right. But not totally. ;-)

If you deny password-authentication and only permit public-key-authentication then "root" access from the internet is as safe as your public-key is. ;-)

This is even safer than logging in als mortal and then gaining root-access via "su" or "sudo".
If only public-key-authorization is permittet you can only access the machine if you are in possession of the private key and no brute force attack will ever succeed. 8-)

But I must admit, in many cases it is more convinient to simply deny root access and permit password-authentication.

On the other side with ubiquitous USB-Sticks (even as MP3-Players or watches) it is most of the time possible to rely on safe public-key-authorization.


Possibly

Pollyanna
 
Old 11-26-2004, 09:34 PM   #6
ttilt
Member
 
Registered: Dec 2003
Location: Campinas, Brasil
Distribution: slackware 10
Posts: 150

Original Poster
Rep: Reputation: 15
wow it's good to be in the company of knowledgeable people.. :-)

but u see eelvis, the DISPLAY var was supposed to be set correctly if I do a su, and not su -, because that way I'm changing users without a full login and without the reset of environment variables, which means the DISPLAY var should still be set to 0:0.

And that's what happens, but if I try to run emacs then, I get an error msg, and emacs doesn't start at all, as opposed to starting in console mode when I do su -. I dont remember the error msg now but I can do that again if u want.

As for the authentication, I agree w/ u Polyana, public-keys auth is the most secure method, but it's just not very convenient having to rely on ssh just to switch to su... I recently installed slackware and right now nothing works right.. no sound, no internet (i have a thomson speedtouch usb adsl modem)...

But since I'm talking to knowledgeable ppl, lemme ask u this: Do any of u use X on 1152x864 resolution? Because that's what I'm trying to set mine to but it doesn't display that resolution correctly.. it seems to be at a much higher resolution and at 60hz when it should be at 75. I've correctly set the xorgconfig file so I don't know what could be wrong there. I've configured the monitor correctly too (monitor that does 1280x1024 at 60hz), which should trigger the 75hz at 1152x864, as in windows, shouldn't it...?

last question: is there a way to confirm which resolution i'm currently using ?

mit freundlichen grussen,
JC
 
Old 11-27-2004, 10:08 AM   #7
Pollyanna
Member
 
Registered: Oct 2003
Location: Germany
Distribution: Slackware 10.2, SuSE 10.0, Solaris(SPARC) 9+Solaris(x86) 9, NetBSD(sparc) 2.0.2
Posts: 43

Rep: Reputation: 15
Exclamation xhost helps but is a dangerous friend

Hi ttilt,

this is how i did it. ;-)

> su
Password:
# xclock
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

Error: Can't open display: :0
#

Then I did a seach at google.de for
"Xlib: connection to ":0.0" refused by server"
where among the first five results
http://web.sequenz.ch/i396/xlib_conn...rver_note.html
http://www.experts-exchange.com/Oper..._20762091.html
http://www.pc-magazin.de/praxis/wind...hp?nr=2&id=565
all suggested:

as *user* who invoked the X-Server to simply

> xhost +
access control disabled, clients can connect from any host
> su
Password:
# xclock

and it worked.

BUT!
As you can read in the output remark of "xhost +": THIS ENABLES CONNACT FROM ANY HOST!
DO NOT DO THIS, IT IS BAD! 8-(

Better Solution but STILL FAR FROM SAFE:
> xhost +localhost
which simply did't work for me, sorry. 8-(

This is the reason why I prefer
> ssh -x root@localhost

If "X-Forwarding" is allowed in /etc/ssh/sshd_config everything works without any security breach and by using public-key-authorization I have only one password to remember.

Regarding your multiple problems I suggest solving one problem at a time and opening a new threat for each so more poeple know from the beginning what kind of help is needed. 8-)
I have no idea of USB-DSL-Modems on Slackware, because I have a tiny home network with "IPCop" on a 486DX100 and 20 MB Ram watching the gate. ;-)

And I am sorry to tell you that I am also no kind of X-expert, too.
The only thing I can point out is to look for your "XFree86.log", the logfile of your X-server. But be carefull, there may be more than one around. Watch out for the most recent. There your resolution and refreshrate sould be noted.


Unknowing Pollyanna
 
Old 11-28-2004, 11:34 AM   #8
ttilt
Member
 
Registered: Dec 2003
Location: Campinas, Brasil
Distribution: slackware 10
Posts: 150

Original Poster
Rep: Reputation: 15
the syntax is xhost local:root, which will allow access only to root from local machine. Which I don't think is a big security breach is it?

internet is working too now, only thing that's left is sound, but I'll start a new thread for that

Thanks for all the help
 
Old 12-01-2004, 11:36 AM   #9
Pollyanna
Member
 
Registered: Oct 2003
Location: Germany
Distribution: Slackware 10.2, SuSE 10.0, Solaris(SPARC) 9+Solaris(x86) 9, NetBSD(sparc) 2.0.2
Posts: 43

Rep: Reputation: 15
Hi ttilt,

thank you for this information. It seem secure enought not to allow network access.

There is still one problem left:
If you "su -" the environment is not inherited, so $DISPLAY ist empty and has to be set manually. This example does only work if your $DISPLAY is *actually* :0.

> echo $DISPLAY
:0
> su -
# DISPLAY=:0
# export DISPLAY
# xclock &

8-)

I prefer using "su -" over "su" because the environment of "root" is imported at login, so customization or aliases set as "root" will work.
But at the same time the environment of "user" is lost, as it is $DISPLAY.

Did I mention before that I prefer "ssh -x root@localhost" over "su" and "su -"?
;-)


Redundant Greetings

Pollyanna
 
Old 12-01-2004, 04:12 PM   #10
ttilt
Member
 
Registered: Dec 2003
Location: Campinas, Brasil
Distribution: slackware 10
Posts: 150

Original Poster
Rep: Reputation: 15
yea that's why i set DISPLAY at the /etc/profile which will be set for everyone that logs in.

If u notice, it seems that they forgot to set that variable there, after all they export DISPLAY but without ever setting it.

So by doing that root will get display when u do a su - too.
enjoy :-)
 
  


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
running scheme through emacs phoeniks Linux - Software 5 10-18-2004 01:12 AM
running emacs in su mode wont open x window true_atlantis Linux - Software 2 05-05-2004 01:05 AM
problem with running emacs as su jsfour Slackware 2 12-04-2003 02:11 PM
emacs running winDOS programs trough wine or similar software ? jamaso Linux - General 2 11-19-2003 07:41 AM
Problem running emacs when su jkcunningham Linux - General 5 06-24-2002 09:20 PM

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

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