LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-20-2007, 03:40 PM   #1
deesto
Member
 
Registered: May 2002
Location: NY, USA
Distribution: FreeBSD, Fedora, RHEL, Ubuntu; OS X, Win; have used Slackware, Mandrake, SuSE, Xandros
Posts: 448

Rep: Reputation: 31
Question 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)?
 
Old 07-21-2007, 12:48 PM   #2
mhm
Member
 
Registered: Oct 2006
Distribution: RHEL, FC
Posts: 58

Rep: Reputation: 15
hey,
Try to do xhost+ from that user or search in the xorg.conf may u can find something has to do with ur case.
 
Old 07-23-2007, 09:35 AM   #3
deesto
Member
 
Registered: May 2002
Location: NY, USA
Distribution: FreeBSD, Fedora, RHEL, Ubuntu; OS X, Win; have used Slackware, Mandrake, SuSE, Xandros
Posts: 448

Original Poster
Rep: Reputation: 31
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).
 
Old 07-23-2007, 02:14 PM   #4
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
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.
 
Old 07-23-2007, 03:12 PM   #5
deesto
Member
 
Registered: May 2002
Location: NY, USA
Distribution: FreeBSD, Fedora, RHEL, Ubuntu; OS X, Win; have used Slackware, Mandrake, SuSE, Xandros
Posts: 448

Original Poster
Rep: Reputation: 31
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).
 
  


Reply



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
SSH issue ""Server unexpectedly closed network connection" Errsta_Fonzarelli Linux - Software 12 05-24-2010 02:35 PM
Why does "crond" sleep and "ssh" hung up? Chowroc Linux - Networking 0 01-12-2006 12:24 AM
"X-MS" cant open because "x-Multimedia System" cant access files at "smb&qu ponchy5 Linux - Networking 0 03-29-2004 11:18 PM
need help, on how to access quickly to special characters like "ñ" or "á"? Motaro Linux - Newbie 1 12-31-2003 11:53 AM
"socks5" -> "http" proxy protocol, or ssh tunnel to sock5 ? I'm beyond http p vmicho Linux - Networking 2 12-16-2003 05:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:03 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration