- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: gui commands doesnt works when running via sud...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-20-2010 04:02 AM
тАО02-20-2010 04:02 AM
gui commands doesnt works when running via sudo
access control disabled, clients can connect from any host
jodt@tiger:~/Desktop> sudo firefox
Error: no display specified
jodt@tiger:~/Desktop> sudo virt-manager
Unable to initialize GTK: could not open display
jodt@tiger:~/Desktop>
only "sudo /sbin/yast2" works, but in TUI(ncurses) mode
all of the above commands works nicely when I did "su - root"
what should I do, please help
Regards
Maaz
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-20-2010 04:21 AM
тАО02-20-2010 04:21 AM
Re: gui commands doesnt works when running via sudo
#xhost +
than
# DISPLAY=ip_address:0.0;export DISPLAY
than try and also note ip_address should be of the same machine on which you want to diaplay your gui
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-20-2010 11:09 AM
тАО02-20-2010 11:09 AM
Re: gui commands doesnt works when running via sudo
I did followinf
jodt@tiger:~/Desktop> xhost +
jodt@tiger:~/Desktop> DISPLAY=127.0.0.1:0.0; export DISPLAY
but no gain.. same errors.
I am working on this box directly(no network ..ssh etc)
Regards
Maaz
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-20-2010 04:33 PM
тАО02-20-2010 04:33 PM
Re: gui commands doesnt works when running via sudo
SAM has a restricted sam builder on 11.23 and lower so a non-root user can user their regular id to do system admin tasks in sam.
In 11.31 the system management homepage can be configured to allow a non-root person to do different tasks with their regular userid. This way sudo is not necessary.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-21-2010 02:37 AM
тАО02-21-2010 02:37 AM
Re: gui commands doesnt works when running via sudo
I can't find the exact manual page but you have to change one of the 'sysconfig' files to enable local access to the desktop.
Some distributions such as Fedora, Mandriva, and Red Hat, use the prefdm script to decide on the XDMCP server to run. Linux runs the prefdm script that loads ├в /etc/sysconfig/desktop├в file. The DESKTOP line in ├в /etc/sysconfig/desktop├в file sets the default desktop environment, which sets the default XDMCP server.
The ├в /etc/X11/xdm/Xaccess├в file is a configuration file of XDM. You can configure XDM server for remote access. The /etc/X11/xdm/Xaccess file controls access of XDM server. You can make use of an asterisk (*) to provide access of the system to anyone. The * CHOOSER BROADCAST line as displayed on the screen, tells XDM that anyone may request chooser that accepts XDMCP connections
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-21-2010 02:46 AM
тАО02-21-2010 02:46 AM
Re: gui commands doesnt works when running via sudo
there is no SAM here, I am using a Linux distro(SUSE 11)
I think SAM is a YaST equivalent in HP-UX
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-21-2010 06:32 AM
тАО02-21-2010 06:32 AM
Re: gui commands doesnt works when running via sudo
echo $DISPLAY
> all of the above commands works nicely when
> I did "su - root"
su - root
echo $DISPLAY
What's different?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-21-2010 09:24 AM
тАО02-21-2010 09:24 AM
Re: gui commands doesnt works when running via sudo
Hi Steven Schweda Thanks for help
jodt@tiger:~/Desktop> sudo firefox
Error: no display specified
jodt@tiger:~/Desktop> echo $DISPLAY
:0.0
jodt@tiger:~/Desktop> su - root
Password:
tiger:~ # echo $DISPLAY
:0.0
tiger:~ #
Hi Andrew Cowan thanks for help
/etc/sysconfig/console, /etc/sysconfig/displaymanager, and /etc/X11/xdm/Xaccess attached.
tiger:~ # grep -v ^# /etc/X11/xdm/Xaccess
* #any host can get a login window
* CHOOSER BROADCAST #any indirect host can get a chooser
tiger:~ # grep -v ^# /etc/sysconfig/displaymanager
DISPLAYMANAGER="gdm"
DISPLAYMANAGER_REMOTE_ACCESS="no"
DISPLAYMANAGER_ROOT_LOGIN_REMOTE="no"
DISPLAYMANAGER_STARTS_XSERVER="yes"
DISPLAYMANAGER_XSERVER_TCP_PORT_6000_OPEN="no"
DISPLAYMANAGER_AUTOLOGIN=""
DISPLAYMANAGER_PASSWORD_LESS_LOGIN="no"
DISPLAYMANAGER_AD_INTEGRATION="no"
DISPLAYMANAGER_SHUTDOWN="auto"
DISPLAYMANAGER_RANDR_MODE_VGA=""
DISPLAYMANAGER_RANDR_MODE_auto="1024x768_60 64.11 1024 1080 1184 1344 768 769 772 795 -HSync +Vsync"
DISPLAYMANAGER_XSERVER="Xorg"
tiger:~ # grep -v ^# /etc/sysconfig/console
CONSOLE_FONT="lat9w-16.psfu"
CONSOLE_UNICODEMAP=""
CONSOLE_SCREENMAP="trivial"
CONSOLE_MAGIC="(K"
FB_MODULES=""
FBSET_PARAMS=""
CONSOLE_ENCODING="UTF-8"
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-21-2010 10:32 AM
тАО02-21-2010 10:32 AM
Re: gui commands doesnt works when running via sudo
> Error: no display specified
> jodt@tiger:~/Desktop> echo $DISPLAY
> :0.0
That shows what DISPLAY is in your _normal_
environment, _after_ the "sudo xxx" command
has failed. What I'd like to know is what
DISPLAY is _in_ the "sudo" environment.
I don't use sudo, so I know nothing, but if
it doesn't pass through your DISPLAY setting,
then you might try writing a script which
sets DISPLAY and then runs your browser, and
then try running "sudo your_script". Or, for
example, something like:
sudo DISPLAY=':0.0' firefox
or:
sudo firefox --display ':0.0'
"man firefox" seems to do nothing good around
here, but there's some value in:
firefox --help
Most X programs offer a "-display" (or,
apparently, a "--display") option.
man X
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-21-2010 10:43 AM
тАО02-21-2010 10:43 AM
Re: gui commands doesnt works when running via sudo
Take a look at these links:
http://www.linuxjournal.com/content/getting-vncserver-running-core-10-gdm
http://www.idevelopment.info/data/Unix/Linux/LINUX_ConfiguringXDMCPRedHatLinux.shtml
Your problem is caused by the GDM security that allows your user to open windows within their own session but it disallows another user, so when you su within a shell, GDM does not see it because it is still running as your user.