LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   emacs not running in a windows (https://www.linuxquestions.org/questions/slackware-14/emacs-not-running-in-a-windows-259546/)

ttilt 11-26-2004 11:16 AM

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?

eelriver 11-26-2004 01:18 PM

The xserver is "bound" to the user that logged into it and won't run another instance for a new user by default.

Pollyanna 11-26-2004 02:07 PM

$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

eelriver 11-26-2004 04:08 PM

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.

Pollyanna 11-26-2004 05:48 PM

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

ttilt 11-26-2004 08:34 PM

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

Pollyanna 11-27-2004 09:08 AM

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

ttilt 11-28-2004 10:34 AM

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

Pollyanna 12-01-2004 10:36 AM

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

ttilt 12-01-2004 03:12 PM

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 :-)


All times are GMT -5. The time now is 11:46 PM.