How to hide the warning message “connect_to localhost port 9000: failed.” when I do a reverse SSH tunnel

ssh-tunnelxdebug

I am currently using a reverse SSH tunnel

ssh user@myserver.com -R 9000:localhost:9000

to forward Xdebug (a PHP debugging tool) packets from my server to my local machine. I also have the feature xdebug.remote_autostart=1 so that any site I visit (including AJAX calls) on myserver.com forwards a Xdebug packet.

However, if I don't want to currently debug PHP and I'm not listening to port 9000 on my local machine, then my SSH session gives the warning

connect_to localhost port 9000: failed.

Since I browse through a lot of pages on myserver.com, my bash shell will easily fill up with hundreds of these messages.

So is there a way to hide these warning messages?

Best Answer

ssh -q seems to have done the trick. It now ignores the connect_to localhost port 9000: failed., but if you have other terminals with other ssh sessions to the same host, then you'll need to restart them with the -q flag too.