Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I set a user agent for the ssh program? Network requests made without a user agent are blocked on my network and I'm wondering if ssh is throwing a "Connection reset by peer" error because of this. I know it's not related to ports because I've tried many different common and uncommon ports to no avail.

Does the ssh program send one by default?

share|improve this question
Are you sure this is the issue? What's the actual error message shown? – cpast Feb 10 '13 at 1:41
up vote 5 down vote accepted

User agent is a HTTP header, and SSH doesn't use the HTTP protocol. Therefore, SSH cannot specify a user agent.

It's more likely that destination port 22 is blocked. To circumvent this, you can specify additional listening ports on the server in /etc/ssh/sshd_config.


# What ports, IPs and protocols we listen for
Port 22
Port 8080

In your client machine, you have to specify the port either manually when connecting or in the config file.

Example for manual method:

ssh -p 8080

Example entry in system-wide /etc/ssh/ssh_config or the per-user ~/.ssh/config:

Port 8080

If your conections get blocked due to packet inspection, you may need to use a HTTPS proxy. Apache2 can be used as a proxy if it's already installed.

If you install a HTTPS proxy on your server, you can use this command

ssh -o "ProxyCommand nc -X connect -x %h %p"

or add

Port ProxyCommand nc -X connect -x %h %p

in a SSH config file.

You could also use a web-based solution like shellinabox.

share|improve this answer
Thank you, that makes sense. It's not the ports though, I've tried 80, 8080, 1337, etc. – Vreality Feb 10 '13 at 1:42
Packet inspection can distinguish real HTTP traffic from other traffic on port 80. Some workplaces/ISPs also force you to send all outgoing traffic through their proxy. DO you use a proxy in your web beowser? – Dennis Feb 10 '13 at 1:47
No, but you might be correct on the packet inspection. Is there any alternative to ssh that uses https or something? Not a glype proxy or anything, but a secure terminal access. – Vreality Feb 10 '13 at 1:50
You can keep using SSH with a proxy. Does the server have apache2 installed? – Dennis Feb 10 '13 at 2:03
VPN would be great if allowed. But if SSH access is blocked... apache2 can be used as a proxy, but that only makes sense if it's already installed. If you install a HTTPS proxy on your server, you can use ssh -o "ProxyCommand nc -X connect -x %h %p" You could also use a web-based solution like shellinabox. – Dennis Feb 10 '13 at 2:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .