Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
sshd and x11 port forwarding not working
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
rajl
Apprentice
Apprentice


Joined: 25 Sep 2002
Posts: 287

PostPosted: Tue Feb 25, 2003 12:50 am    Post subject: sshd and x11 port forwarding not working Reply with quote

I have sshd setup to allow ssh connections into my computer, but I have not been able to get x11 port forwarding (using ssh -X) to work for the life of me. When I log in from another box using "ssh -X", and then type "emacs filename &" or someother x11 program, (emacs being the one I typically use), I get the following error:

Code:

_X11TransSocketINETConnect: Can't get address for localhost
emacs: Cannot connect to X server localhost:10.0.
Check the DISPLAY environment variable or use `-d'.
Also use the `xhost' program to verify that it is set to permit
connections from your machine.


I assume I have my sshd_config file setup correctly, but here it is just in case:

Code:

#       $OpenBSD: sshd_config,v 1.59 2002/09/25 11:17:16 markus Exp $

# This is the sshd server system-wide configuration file.  See
# sshd_config(5) for more information.

# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented.  Uncommented options change a
# default value.

#Port 22
Protocol 2
#ListenAddress 0.0.0.0
#ListenAddress ::

# HostKey for protocol version 1
#HostKey /etc/ssh/ssh_host_key
# HostKeys for protocol version 2
#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_dsa_key

# Lifetime and size of ephemeral version 1 server key
#KeyRegenerationInterval 3600
#ServerKeyBits 768

# Logging
#obsoletes QuietMode and FascistLogging
SyslogFacility AUTH
LogLevel INFO

# Authentication:

#LoginGraceTime 120
PermitRootLogin no
#StrictModes yes

#RSAAuthentication yes
#PubkeyAuthentication yes
#AuthorizedKeysFile     .ssh/authorized_keys

# rhosts authentication should not be used
#RhostsAuthentication no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#RhostsRSAAuthentication no
# similar for protocol version 2
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and HostbasedAuthentication
#IgnoreUserKnownHosts no

# To disable tunneled clear text passwords, change to no here!
#PasswordAuthentication yes
#PermitEmptyPasswords no

# Change to no to disable s/key passwords
#ChallengeResponseAuthentication yes

# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes

#AFSTokenPassing no

# Kerberos TGT Passing only works with the AFS kaserver
#KerberosTgtPassing no

# Set this to 'yes' to enable PAM keyboard-interactive authentication
# Warning: enabling this may bypass the setting of 'PasswordAuthentication'
#PAMAuthenticationViaKbdInt no

X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes
#PrintMotd yes
#PrintLastLog yes
#KeepAlive yes
#UseLogin no
#UsePrivilegeSeparation yes
#PermitUserEnvironment no
#Compression yes

#MaxStartups 10
# no default banner path
#Banner /some/path
#VerifyReverseMapping no

# override default of no subsystems
Subsystem       sftp    /usr/lib/misc/sftp-server


I've read other forum posts on the subject, which is why I set the x11displayoffset and x11uselocalhost variables as well. I then restarted sshd. Still no go. Does anyone have any other suggestions of how to get x11 port forwarding to work? This is a feature that I would really like to make use of.
_________________
-Rajl

-----------------------------------------------------------
It's easy to be brave once you consider the alternatives.
Back to top
View user's profile Send private message
sieter
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jan 2003
Posts: 111

PostPosted: Tue Feb 25, 2003 11:33 am    Post subject: Reply with quote

Try without
x11displayoffset and x11uselocalhost

that´s what i have:

X11Forwarding yes
Compression yes

and it works :)
Back to top
View user's profile Send private message
rtn
Guru
Guru


Joined: 15 Nov 2002
Posts: 427

PostPosted: Tue Feb 25, 2003 3:45 pm    Post subject: Reply with quote

Do you have an entry in /etc/hosts for localhost?

Code:
127.0.0.1               localhost.localdomain localhost


Does your hosts: line in /etc/nsswitch.conf reference 'files' ?

Code:
hosts:      files dns


--rtn
Back to top
View user's profile Send private message
rajl
Apprentice
Apprentice


Joined: 25 Sep 2002
Posts: 287

PostPosted: Tue Feb 25, 2003 4:11 pm    Post subject: Reply with quote

I originally tried it without x11displayoffset and x11uselocalhost, and it didn't work then either. I added that line to to /etc/hosts as reccommended...but I have to go to work and and log back in from there to test it. The line in nssswitch.conf was already there. Hopefully it works.
_________________
-Rajl

-----------------------------------------------------------
It's easy to be brave once you consider the alternatives.
Back to top
View user's profile Send private message
rtn
Guru
Guru


Joined: 15 Nov 2002
Posts: 427

PostPosted: Tue Feb 25, 2003 4:58 pm    Post subject: Reply with quote

If you didn't have a localhost entry in your /etc/hosts, I'd pretty much guarantee
that was your problem. If you look closely at your original error message, it clearly
says that it can't lookup localhost.

It doesn't really matter if you uncomment X11DisplayOffset and X11UseLocalhost
if you don't change their values, the values listed after the comment are default,
so uncommenting them wouldn't have changed anything.

--rtn
Back to top
View user's profile Send private message
rajl
Apprentice
Apprentice


Joined: 25 Sep 2002
Posts: 287

PostPosted: Tue Feb 25, 2003 7:47 pm    Post subject: Reply with quote

yep, the local host not being listed in hosts was the problem. thanks guys. it's really nice being able to do this x11 port forwarding. right now, I'm logged in to my box at home, browsing with mozilla 1.2.1, typing this message. Reason I'm doing it this way, though it is a bit slower, is because netscape 4.7 on the sun workstation I'm working on doesn't like viewing the forums for whatever reason. Anyway, once again, thank you.
_________________
-Rajl

-----------------------------------------------------------
It's easy to be brave once you consider the alternatives.
Back to top
View user's profile Send private message
rtn
Guru
Guru


Joined: 15 Nov 2002
Posts: 427

PostPosted: Tue Feb 25, 2003 8:08 pm    Post subject: Reply with quote

rajl wrote:
yep, the local host not being listed in hosts was the problem. thanks guys. it's really nice being able to do this x11 port forwarding. right now, I'm logged in to my box at home, browsing with mozilla 1.2.1, typing this message. Reason I'm doing it this way, though it is a bit slower, is because netscape 4.7 on the sun workstation I'm working on doesn't like viewing the forums for whatever reason. Anyway, once again, thank you.


You know, you could always put gentoo on that sun workstation... :twisted:

--rtn
Back to top
View user's profile Send private message
rajl
Apprentice
Apprentice


Joined: 25 Sep 2002
Posts: 287

PostPosted: Wed Feb 26, 2003 2:26 am    Post subject: Reply with quote

I would...but the administrator in charge of my department wouldn't like that I don't think...I'd rather not get fired :wink:
_________________
-Rajl

-----------------------------------------------------------
It's easy to be brave once you consider the alternatives.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum