Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
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: FreeBSD, Fedora, RHEL, Ubuntu; OS X, Win; have used Slackware, Mandrake, SuSE, Xandros
Posts: 448
Rep:
enabling ssh X access for "su"
I'm wondering whether there's a way to let users run X apps with "su - <user>" (or even "su <user>") after connecting via ssh.
If I ssh into a network machine (RHEL4, OpenSSH 3.9p1, OpenSSL 0.9.7a) as root, and I can run X apps. I did an "xhost +" as root to authorize users. Now, if I ssh directly to the machine as the user, I can display X. But if I ssh as root and then "su" to the user (which is what I would like to do) and try an X app, it returns:
X11 connection rejected because of wrong authentication.
I believe this has to do with ssh X-forwarding. I wonder whether it's possible to enable root to switch to this user and to run X apps (despite the security implications)?
Distribution: FreeBSD, Fedora, RHEL, Ubuntu; OS X, Win; have used Slackware, Mandrake, SuSE, Xandros
Posts: 448
Original Poster
Rep:
Thanks. Tried that as the user (su - <user>), and I get: $ xhost +
X11 connection rejected because of wrong authentication.
X connection to localhost:10.0 broken (explicit kill or server shutdown).
Try passing the -Y option to your SSH command instead of -X. This is slightly less secure, but slightly more convenient. YMMV. I use it all the time between computers I control.
Distribution: FreeBSD, Fedora, RHEL, Ubuntu; OS X, Win; have used Slackware, Mandrake, SuSE, Xandros
Posts: 448
Original Poster
Rep:
I thought that might help, but passing -Y as root, su - <user>, and then xhost + gives the same result as before, except the display shows a different number (localhost:12.0 instead of localhost:10.0).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.