IPV6 required for X11 Forwarding with SSH? Can this be fixed?

I ran into this years ago, and completely forgot the “solution”. I use `ssh -X root@localhost’ so that I can run X apps from a root authenticated xterm. I’ve been doing so for years. I just did a new install of openSuse 13.1 and got the error message:

X11 forwarding request failed on channel 0

when I sshed to root.

It makes perfect sense to disable IPV6 on a network where it is not used. Unfortunately, the only way I know to get `ssh -X’ to work is to enable IPV6. Is there a way to make ssh to work without enabling the unnecessary IPV6?

This issue cost me a lot of time, again.

Have you tried:


ssh -4 -X localhost

or have you tried adding a line


AddressFamily inet

to either your own “.ssh/config” or to “/etc/ssh/ssh_config”?

I don’t disable IPv6 here, so I have not run into your problem. It seems mostly harmless to leave IPv6 enabled, even when your ISP does not support it.

I am able to do “ssh -X root@localhost” even with IPv6 disabled. But I get a lot of interesting error messages, when I start applications in this root ssh session.
Why don’t you use a simple “su” to become root in a terminal?

Hendrik

Yes, the Golden Rule is in any case not to log in as root, particularly not over the network. So first ssh as a normal user, then do

su -

and not the simple su as suggested.

On 06/29/2014 03:36 PM, hcvv pecked at the keyboard and wrote:
> hendwolt;2651362 Wrote:
>> I am able to do “ssh -X root@localhost” even with IPv6 disabled. But I
>> get a lot of interesting error messages, when I start applications in
>> this root ssh session.
>> Why don’t you use a simple “su” to become root in a terminal?
>>
>> Hendrik
> Yes, the Golden Rule is in any case not to log in as root, particularly
> not over the network. So first ssh as a normal user, then do
>
> Code:
> --------------------
> su -
> --------------------
>
> and not the simple su as suggested.
>
>

I have better luck using kdesu after a login to the remote machine using
my login.

Ken

That is of course the same principle (and there are similar solutions when one uses Gnome, …).

But he logs in using SSH and that is a CLI session. You do remote login to a GUI session.

You can run “kdesu” (or “gnomesu” or “xdg-su”) in a remote session via SSH (that is a CLI session) as well to start GUI applications as root. I think that’s what kensch meant.

On 06/29/2014 04:36 PM, hcvv pecked at the keyboard and wrote:
> kensch;2651378 Wrote:
>>
>> I have better luck using kdesu after a login to the remote machine using
>> my login.
>>
>> Ken
> That is of course the same principle (and there are similar solutions
> when one uses Gnome, …).
>
> But he logs in using SSH and that is a CLI session. You do remote login
> to a GUI session.
>
>

I SSH in using konsole in a KDE GUI session.

Ken

On Sat, 28 Jun 2014 22:26:01 +0000, hattons wrote:

> I ran into this years ago, and completely forgot the “solution”. I use
> `ssh -X root@localhost’ so that I can run X apps from a root

authenticated xterm. I’ve been doing so for years. I just did a new
install of openSuse 13.1 and got the error message:

Code:

X11 forwarding request failed on channel 0

when I sshed to root.

It makes perfect sense to disable IPV6 on a network where it is not
used. Unfortunately, the only way I know to get `ssh -X’ to work is to
> enable IPV6. Is there a way to make ssh to work without enabling the
> unnecessary IPV6?
>
> This issue cost me a lot of time, again.

IIRC, you need to change the AddressFamily in /etc/ssh/sshd_config to
“inet” instead of the default of “any”.

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

On Sat, 28 Jun 2014 22:26:01 GMT, hattons
<hattons@no-mx.forums.opensuse.org> wrote:

>
>I ran into this years ago, and completely forgot the “solution”. I use
>`ssh -X root@localhost’ so that I can run X apps from a root

authenticated xterm. I’ve been doing so for years. I just did a new
install of openSuse 13.1 and got the error message:

Code:

X11 forwarding request failed on channel 0

when I sshed to root.

It makes perfect sense to disable IPV6 on a network where it is not
used. Unfortunately, the only way I know to get `ssh -X’ to work is to
>enable IPV6. Is there a way to make ssh to work without enabling the
>unnecessary IPV6?
>
>This issue cost me a lot of time, again.

Very interesting (strange). I have a mix of oS 11.4, 12.1, and 12.3 and
use

ssh -X <target machine>

all the time. If i need to do administrative chores remotely i use

su -

from the Konsole level where i did ssh -X from.

No IPv6 on any of the machines.

I also run

ssh -X

on multiple tabs of Konsole from the same client to the same target
machines almost all the time.

If i want i can use or administer any machine from any machine at any
time.

?-)