You are not logged in.

#1 2013-02-04 17:36:00

fivre
Member
Registered: 2007-04-17
Posts: 92

Can't tunnel over ssh: "Firewall policy violation"

I'm unable to tunnel traffic over ssh using -D dynamic forwarding. I believe the relevant options are set in sshd_config (PermitTunnel/AllowTcpForwading), I've restarted the daemon, and iptables is disabled, but I'm still getting this message:

channel 3: open failed: administratively prohibited: Firewall policy violation

Nothing shows up anywhere in the logs with LogLevel=DEBUG.

There isn't any issue with restarting sshd with active sessions, is there? It looks like it took the new LogLevel okay.

Config:

#       $OpenBSD: sshd_config,v 1.87 2012/07/10 02:19:15 djm 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 override the
# default value.

#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

# The default requires explicit activation of protocol 1
#Protocol 2

# 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
#HostKey /etc/ssh/ssh_host_ecdsa_key

# Lifetime and size of ephemeral version 1 server key
#KeyRegenerationInterval 1h
#ServerKeyBits 1024

# Logging
# obsoletes QuietMode and FascistLogging
#SyslogFacility AUTH
#LogLevel INFO

# Authentication:

#LoginGraceTime 2m
PermitRootLogin no
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

#RSAAuthentication yes
PubkeyAuthentication yes

# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
# but this is overridden so installations will only check .ssh/authorized_keys
AuthorizedKeysFile      .ssh/authorized_keys

#AuthorizedPrincipalsFile none

# 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
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes

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

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

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

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes

# Set this to 'yes' to enable PAM authentication, account processing, 
# and session processing. If this is enabled, PAM authentication will 
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes

AllowAgentForwarding yes
AllowTcpForwarding yes
#GatewayPorts no
#X11Forwarding no
#X11DisplayOffset 10
#X11UseLocalhost yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
UsePrivilegeSeparation sandbox          # Default for new installations.
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS yes
#PidFile /run/sshd.pid
#MaxStartups 10
PermitTunnel yes
#ChrootDirectory none
#VersionAddendum none

# no default banner path
#Banner none

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

# Example of overriding settings on a per-user basis
#Match User anoncvs
#       X11Forwarding no
#       AllowTcpForwarding no
#       ForceCommand cvs server

Offline

#2 2013-02-04 19:35:51

Leonid.I
Member
From: Aethyr
Registered: 2009-03-22
Posts: 948

Re: Can't tunnel over ssh: "Firewall policy violation"

What exactly are you trying to accomplish? SSH socks proxy is a client feature and has nothing to dowith the server setup. PermitTunnel is a completely unrelated option -- see man sshd_config.

For instance, suppose you have a client (C) and a server (S), and want to tunnel all web traffic from C through a ssh tunnel C-S. Then, on the client call

C$ ssh -xND 12345 S.ip &

This will open a tunnel to S without a shell, open port 12345 on localhost, and put ssh process in the bg. Next, in your browser's connections settings point to <user>@localhost.localdomain:12345. It is assumed that you have no control over S.


Arch Linux is more than just GNU/Linux -- it's an adventure

Offline

#3 2013-02-04 20:02:38

fivre
Member
Registered: 2007-04-17
Posts: 92

Re: Can't tunnel over ssh: "Firewall policy violation"

I'm trying to create a SOCKS proxy for Firefox (or whatever) to connect through. The client is on Windows, but Windows Firewall doesn't appear to be blocking it (same behavior if it's disabled) and I don't know what else would be blocking it (i.e. something on the corporate LAN) since it's on localhost.

Offline

#4 2013-02-04 20:27:26

Leonid.I
Member
From: Aethyr
Registered: 2009-03-22
Posts: 948

Re: Can't tunnel over ssh: "Firewall policy violation"

fivre wrote:

I'm trying to create a SOCKS proxy for Firefox (or whatever) to connect through. The client is on Windows, but Windows Firewall doesn't appear to be blocking it (same behavior if it's disabled) and I don't know what else would be blocking it (i.e. something on the corporate LAN) since it's on localhost.

What ssh software do you use on Win? You have to to configure SOCKS in _client_ not server. AFAIU putty is able to do SOCKS proxy, but I have never tried it.


Arch Linux is more than just GNU/Linux -- it's an adventure

Offline

#5 2013-02-04 21:01:28

fivre
Member
Registered: 2007-04-17
Posts: 92

Re: Can't tunnel over ssh: "Firewall policy violation"

Tried putty and cygwin.

It looks like there's some magic on the gateway that's screwing with SSH, so I might have to go with something like polipo instead.

Offline

Board footer

Powered by FluxBB