LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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 09-08-2007, 08:53 PM   #1
fordwrench
LQ Newbie
 
Registered: Nov 2006
Location: Cleveland, Tx
Distribution: debian,freebsd,slackware, and ubuntu
Posts: 15

Rep: Reputation: 1
xterm error display not set


I am running slackware 12.0 and when I run some scripts I get the following error:

Warning: This program is an suid-root program or is being run by the root user.
The full text of the error or warning message cannot be safely formatted
in this environment. You may get a more descriptive message by running the
program as a non-root user or by removing the suid bit on the executable.
xterm Xt error: Can't open display: %s
xterm: DISPLAY is not set

How can I fix this?


Fordwrench
 
Old 09-08-2007, 09:11 PM   #2
owenjh
Member
 
Registered: Sep 2007
Distribution: Fedora / Slackware
Posts: 46

Rep: Reputation: 15
What program is it that you are trying to run?

Try changing to a non root user and see if the error message comes up (Either by exit, or su)

Normally this happens to me when I have an xterm open and I forget to logout of root.

you can also try to set DISPLAY by doing:
DISPLAY=:0.0

Hope this helps,

- Owen.
 
Old 09-09-2007, 11:47 AM   #3
owenjh
Member
 
Registered: Sep 2007
Distribution: Fedora / Slackware
Posts: 46

Rep: Reputation: 15
Did it help?
 
Old 09-09-2007, 03:20 PM   #4
fordwrench
LQ Newbie
 
Registered: Nov 2006
Location: Cleveland, Tx
Distribution: debian,freebsd,slackware, and ubuntu
Posts: 15

Original Poster
Rep: Reputation: 1
Xterm will open when i run it as a non root user.
And the display command did nothing.
I need to get it to run as root.

Fordwrench
 
Old 09-10-2007, 12:34 AM   #5
acummings
Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 615

Rep: Reputation: 49
Hi,

You have to logon as root then startx as root in order to use x as root. (not normally a recommended procedure).

What you experience is normal. It is due to a default (out of the box) security measure.

This has been gone over before in this forum and solutions provided (including the needed mod if you want to go around the mentioned security measure).

I don't remember the mod. I searched, trying to find the thread (didn't find it).

I think it was within the last 7 to 9 months or less

Ok, I found it! It's post # 13 at next:

Code:
http://www.linuxquestions.org/questions/showthread.php?t=566443
Quote:
2) The reason you cannot connect to X server as root is that no user can use another users X server, not even root, without giving them permission.
To do that you need run 'xhost +local:' as the user whos X server it is, then set the DISPLAY variable for the user who wants to use X (in this case root).
Easiest way to do this is put the xhost comand in a startup file. For kde put it in ~/.kde/Autostart/startup. Then set the DISPLAY variable in roots ~/.bashrc or similar: 'export DISPLAY=:0.0'
--
Alan
 
Old 09-10-2007, 02:16 AM   #6
fordwrench
LQ Newbie
 
Registered: Nov 2006
Location: Cleveland, Tx
Distribution: debian,freebsd,slackware, and ubuntu
Posts: 15

Original Poster
Rep: Reputation: 1
Ok I tried to set the xhost in a file called "startup" and "startup."
neither of which worked.

and also created a file called .bashrc and set the display in it also.

didnt work.


Still trying to resolve this.


Fordwrench


Btw I am logging in as root and starting X as root...

Last edited by fordwrench; 09-10-2007 at 02:17 AM. Reason: btw
 
Old 09-10-2007, 12:38 PM   #7
fordwrench
LQ Newbie
 
Registered: Nov 2006
Location: Cleveland, Tx
Distribution: debian,freebsd,slackware, and ubuntu
Posts: 15

Original Poster
Rep: Reputation: 1
when I run xhost +local: I get :


xhost: unable to open display ""
 
Old 09-10-2007, 01:44 PM   #8
acummings
Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 615

Rep: Reputation: 49
Quote:
Btw I am logging in as root and starting X as root...
Well then, that voids (xhost and DISPLAY that I had posted) since I'd assumed you were a user who su to root and then as root was trying to use x server but that the only x server running would be the user's x server -- IOW a case of root trying to use the user's (not root's) x server.

You'll likely need to provide more detail in order to get help. ie, what program, is it supposed to be suid or did it somehow get modified into suid. Specific steps of what you're doing (including how you logon as who and who's x server is running, leading up to and including the error.

How about your x configuration is anything been configured to non-standard here?

--
Alan.
 
Old 09-10-2007, 03:02 PM   #9
fordwrench
LQ Newbie
 
Registered: Nov 2006
Location: Cleveland, Tx
Distribution: debian,freebsd,slackware, and ubuntu
Posts: 15

Original Poster
Rep: Reputation: 1
I am running "airoscript.sh" a script for running the aircrack suite.
I have a basic Slackware 12.0 install with kde as the desktop.

Quote:
is it supposed to be suid or did it somehow get modified into suid
I dont really know what it really means for a program to be suid.


I boot the computer, logon as root, startx, open a terminal window and run the script "./airoscript.sh"

i run
the scan option and when it gets to the point that it is to open an xterm window and run the airodump-ng program. It does not run the airodump-ng and gives the error and returns to beginning of the script menu.


Fordwrench

I dont know if it supposed to be run suid but it does run on the many different live pentest security cds. Ie backtrack,whoppix, whax and auditor

Last edited by fordwrench; 09-10-2007 at 06:22 PM. Reason: suid
 
Old 09-11-2007, 04:34 AM   #10
evilDagmar
Member
 
Registered: Mar 2005
Location: Right behind you.
Distribution: NBG, then randomed.
Posts: 480

Rep: Reputation: 31
If you want to preserve the things in the environment that let you spawn apps to the X display as root, you need to change to root using `su` and not `su -`. The dash basically makes it flush the things you need from the environment.
 
Old 09-12-2007, 12:32 AM   #11
acummings
Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 615

Rep: Reputation: 49
http://linux.about.com/cs/linux101/g...parsetuser.htm

which airodump-ng

then run ls -la on airodump-ng

(so as to find out who owns the suid file)
--

Since at least one of your that you mentioned apps/script has the s bit set on it (suid) then perhaps what you need to do is to find out who the owner of the suid script/app is.

My guess that what I just said is so is because url above tells me that an suid "runs as the owner of this suid, **NOT** as who executed this suid (unless these two [owner/executor] accidentally happen to match)"

**All** of the above leaves it open to "as the root user, you are trying to use a user's (not root's) X server (if perchance the suid bit file/app/script **is OWNED by a user**

All of which -- ie it's root that's trying to use a user's x server. but nonetheless it is the same issue that I shared earlier which is that the use of X is dis allowed except for the user that started x

Why must you run it as root?

Probably you need to run it as a user. If (heaven forbid) you must run it as root then you may need to either remove the s (suid) bit or do as per my former (but in reverse) and once you find **who owns the suid file** given if it is a user

And if you must run it as root then you'll need to get it so that root can use a user's x server (but instead, I'd just remove the suid or s bit).

Are we getting any warmer?

--
Alan.
 
Old 07-26-2012, 08:24 PM   #12
trevor.screws
LQ Newbie
 
Registered: Jul 2012
Posts: 1

Rep: Reputation: Disabled
Check the X11 X Display Location

I got the same error as one of the first posts. I read a tutorial on how to set it up. It said to set the X Display Location = :0.0 - I thought it meant just '0.0'; however, that is incorrect. You should actually put ':0.0' [i.e. include the colon]
 
Old 09-21-2012, 01:30 PM   #13
tonj
Member
 
Registered: Sep 2008
Posts: 234

Rep: Reputation: 22
to the OP:
did you ever resolve this? I'm using backtrack5 and trying to run airoscript-ng and I'm also getting:
Warning: This program is an suid-root program or is being run by the root user etc etc. I can't find a solution to this anywhere. There's no help on this at the backtrack forum or the ubuntu forum. If you resolved it could you share the solution?
 
Old 12-04-2012, 07:28 AM   #14
Varadarajan
LQ Newbie
 
Registered: Dec 2012
Posts: 1

Rep: Reputation: Disabled
In your .profile file located in your home directory, please add "xhost +local:". This will give local users access to X Windows. This is not enough to start gui programs from cron or as background processes without a shell. If you are able to launch your program from a shell as a background process and does not work as cron, then make sure that you have a small program to launch your program via system/shell command. This program can then be configured in cron or other background processes that dont use shell.
 
  


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
can't display ',,,' in xterm.. ichbinesderelch Linux - General 4 07-22-2014 08:17 AM
xterm xt: cant open display - Error - Request solution Sreeram B S Linux - Newbie 3 05-05-2007 03:27 PM
xterm will not display nanjil Suse/Novell 7 10-29-2005 04:05 PM
DISPLAY variable error...cannot set it rameshchandra Linux - General 2 10-09-2005 04:59 AM
Xterm Error Not Able To Display ujnam Linux - Software 2 11-01-2004 06:50 AM


All times are GMT -5. The time now is 12:59 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration