Cannot SSH, X11 forwarding request failed on channel 0


Recommended Posts

I've never really needed to SSH into my unraid box, however after having some duplicated folder issues, I attempted to SSH and could not. At first I found the keys were 0 bytes, so (following another forum post) I deleted the keys and restarted the box. Now when I tried to SSH, after "yes" to continue connecting, and inputting my password, I got "X11 forwarding request failed on channel 0." Per another search, I changed a couple of settings in /etc/ssh/sshd_config, particularly AddressFamily inet, however once saved, and system rebooted, it is changed back to #AddressFamily any.

 

Any thoughts?

 

unRAID OS 6.3.5

Link to comment
7 minutes ago, Rhynri said:

X11 forwarding means forwarding the GUI of an application to your local machine through the SSH connection.   There is more info on what it is and how it's usually done here.  You might be able to reverse-engineer some of those steps to figure out what setting is messing things up for you.

Ahh, got it. All I normally use is terminal and the command line.

Link to comment
1 minute ago, gubbgnutten said:

Just suggesting to check the ssh configuration of the client first before starting to make random modifications to the server's configuration...

Okay I'll look into that. I didn't think it would be a client issue since I am able to SSH from my Ubuntu desktop to other computers without any problem.

Link to comment

Hi,

There's a few possible causes for this. Unless you've manually created another 'user' not a GUI user either, but actually created one via the shell - you'll probably need to use root as the user.

To get more information about the issue, try ssh in verbose mode - it might give you a hint as to what the issue is:

ssh -v root@servername

I'd guess that you're using a user declared via the GUI which will typically result in a missing /home/<username> directory - that'll cause this problem.

You can try to suppress the X11 forwarding by logging in like:

ssh -x root@servername

For whichever affected user (assuming you've gone into the shell and added the user correctly via useradd command) you could also check their ~/.ssh/config file. It may have the following entries:

ForwardX11 yes
ForwardX11Trusted yes

You may want these to be set to 'no' - unless you are actually intending to forward X11 for the specific user.

 

It could also be an issue with your /etc/ssh/sshd_config file but if you haven't fiddled with it (and note that changes will be reset on reboot) then that seems unlikely.

If you do mess with this file and want to test if it worked, you'll need to restart the sshd service. We're going to restart it using the rc.d entry as opposed to the /sbin/ (is it bin?) entry.  I'm noy at my machine right now but it'll be something like:

/etc/rc.d/rc.sshd restart

 

Then you can test your configuration (note this will drop any connected ssh sessions - so have console available if things go awry.) To make the changes permanent, as Rhynri above suggested - you'll need to look into /boot/config/ssh somewhere. To make it easier to find, obviously not a bad idea to just grep for something in that dir - something like:

grep -i X11forwarding /boot/config/ssh/*

 

This should reveal the specific file you'd need to edit - I'd be sure to make a backup somewhere first.

I can't test right now but that should likely point you to the file that's preserved across reboots that initially creates the ram based file at /etc/ssh/sshd_config

 

Hopefully this gets you on the right track,

Del

 

 

Edited by Delarius
fixing words
Link to comment

Delarius and gubbgnutten, much appreciation to you both. Yes I was trying to use my other user, not root. I had not created this user on command line, but in unRAID users. And, indeed, using verbose mode helped a lot, showing me that I was getting disconnected immediately. I was thinking that I had read somewhere that you could not SSH with root, apparently I was mistaken.

 

I am now able to SSH using root! Again, thanks to all for your help.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.