Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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.

Example:

# 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.com

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

Host example.com
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 example.com:8080 %h %p" example.com

or add

Host example.com
Port ProxyCommand nc -X connect -x example.com:8080 %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? –  sudo 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? –  sudo Feb 10 '13 at 2:03
1  
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 example.com:8080 %h %p" example.com. You could also use a web-based solution like shellinabox. –  sudo Feb 10 '13 at 2:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.