Ssh – strange ssh problem: “open failed: administratively prohibited:”

ssh

I have a VPS to be set as my socket5 proxy, the Firefox plugin AutoProxy was installed.

ssh -p 2034 -D 127.0.0.1:1080  root@vps_ip

The port on my VPS is 2034.

The command can work for some time, maybe 10 minutes or 20 minutes,during the time, I opened many web pages with my Firefox, suddenly, the connect was blocked,and an error info displayed.

channel 8: open failed: administratively prohibited
channel 9: open failed: administratively prohibited
channel 10: open failed: administratively prohibited

I have searched the problem on stackoverflow,
for example :SSH tunneling error: "channel 1: open failed: administratively prohibited: open failed"

My problem differ from that!

  1. I just can create ssh tunnel every time properly.
  2. When the ssh tunnel was created,i can browse web pages for sometime,about 10 or 20 minutes.
  3. After many web pages opened by my Firefox,the tunnel broken.
  4. If I close my Firefox and console for sometime, I can create the tunnel again.

It will keep circulating.
What is the matter with my VPS and ssh service?
My system is debian8.1, where is the ssh logfile?no /var/log/secure in my debian.Maybe the ssh logfile can tell more fact.

Best Answer

It sounds like you're running into the SSH server's limit on the number of simultaneous sessions per connection. Your command-line session to the remote server is one session, and each individual forwarded TCP connection is another session.

You can change the server's limit through the MaxSessions parameter in the server's sshd_config file:

MaxSessions
Specifies the maximum number of open sessions permitted per network connection. The default is 10.

You'd update sshd_config like this:

  1. Find the file. It's usually /etc/ssh/sshd_config.
  2. Edit it as root.
  3. In the file look for an existing MaxSessions setting if any. Otherwise, add a new line. Set the number to 15 or so. Save the new file.
  4. Restart sshd to make it reread the file.
  5. Make a new ssh connection and see if the behavior changes.
Related Question