SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: debian,freebsd,slackware, and ubuntu
Posts: 15
Rep:
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
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
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'
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?
Distribution: debian,freebsd,slackware, and ubuntu
Posts: 15
Original Poster
Rep:
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
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.
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).
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]
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?
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.