Re: How to transfer X11 auth across sudo invocation



On Feb 28, 9:31 am, "david.karr" <davidmichaelk...@xxxxxxxxx> wrote:
On Feb 28, 4:11 am, dsharp <sharp.d...@xxxxxxxxx> wrote:



On Feb 27, 3:47 pm, "david.karr" <davidmichaelk...@xxxxxxxxx> wrote:

I connect from my Windows box to a AIX 5.3 box using SecureCRT, which
allows the transfer of X11 packets to my local box.

When I log in as myself into the box, with my local Cygwin-provided X
server running, I can display windows perfectly fine.

However, if after logging in, I then "sudo" to an administrative
account and then try to run something that tries to display windows,
it says that it can't connect.

I tried doing "env | sort" from both my user account and the
administrative account, to compare the differences. On the admin
shell, I set the following env vars from their value on my user
account:

DISPLAY, SSH_AUTH_SOCK, SSH_CLIENT, SSH_CLIENT, SSH_CONNECTION,
SSH_TTY

However, it still fails to connect. I imagine that one of these
variables is "tied" to my user account somehow, and won't work if I
just copy the value over (probably a good idea :) ).

So, what can I do to facilitate this connection from the admin account
to my local box's X server?

When you say you sudo to an admin account, do you mean "su - root" (or
"su -") ? If so, have you tried omitting the dash in the su command
so you don't replace the DISPLAY variable established by SecureCRT
with root's DISPLAY variable? On my AIX box, if I have a working X
tunnel via SSH to my user account and do "su - " then I get the same
results you get, but if I just "su" then I can run x in the root
shell.

Doug

Well, that was promising for a moment.

Apparently my company restricts the non-"-" form more than the "-"
form. I have permission to sudo using "-", but when I do it without
it, it says:

Sorry, user <me> is not allowed to execute '/usr/bin/su <admin>' as
root on <hostname>.

There is a setting in the sudoers config file that controls how env
variables are passed when you run sudo. Maybe the person that manages
your sudoers file can change it for you. See the info about env_keep
and related env info here:
http://www.gratisoft.us/sudo/man/sudoers.html or the comments in the
sudoers file itself. I've used env_keep to manage unusual env
variables for non-root users using sudo on Linux. I manage sudo on
AIX but I haven't used this feature there, so it's possible the AIX
impl doesn't support it. On Linux, for example, the following is a
default:

Defaults env_reset
Defaults env_keep = "COLORS DISPLAY HOSTNAME HISTSIZE INPUTRC
KDEDIR \
LS_COLORS MAIL PS1 PS2 QTDIR USERNAME \
LANG LC_ADDRESS LC_CTYPE LC_COLLATE
LC_IDENTIFICATION \
LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME
LC_NUMERIC \
LC_PAPER LC_TELEPHONE LC_TIME LC_ALL LANGUAGE
LINGUAS \
_XKB_CHARSET XAUTHORITY"

Doug

.



Relevant Pages

  • Re: On resume password protect
    ... ..Net Framework 1.1 is installed onto a Windows XP computer. ... What is the ASP.NET Machine Account? ... ASPNET local user account as an additional user account, ... display Welcome screen is displayed if... ...
    (microsoft.public.windowsxp.security_admin)
  • Re: POP3 Connector
    ... Small Business Server\Networking\POP3\Incoming Mail folder? ... Does the issue happen when other POP3 user account receive mail from ... Re-register the POP3 Connector event sink in Microsoft Internet ... Enable subject logging and display. ...
    (microsoft.public.windows.server.sbs)
  • Re: How to transfer X11 auth across sudo invocation
    ... I can display windows perfectly fine. ... administrative account, to compare the differences. ... copy that, then sudo, ... I have my Cygwin X server running on "laptop". ...
    (comp.unix.aix)
  • Re: Internet Explorer shows: The Page cannot be displayed
    ... Can you please be more precise about this 'privacy setting'. ... > displayed" or IE is slow to find the URL or display it. ... >> user account as John Frost or similar. ... >> Note that you can revert back to your original User Name at any ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: General failure to send or receive with Outlook Express
    ... sure that the Include this account in Send and Receive is checked. ... You will find out information about issues affecting Outlook Express 5/6 at: ... When I> try to retrieve mail, a display flashes on the screen> so briefly I can't see what it is but comparing with OE ...
    (microsoft.public.internet.mail)