Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I need to tunnel my SSH server through an HTTPS port using thttpd (I can change to lighttpd if necessary, but I'm trying to avoid installing Apache since it's an underpowered box). I haven't been able to find anything that confirms or denies this ability of thttpd.

share|improve this question

migrated from stackoverflow.com May 12 '10 at 4:15

This question came from our site for professional and enthusiast programmers.

    
This probably belongs on SuperUser or ServerFault. –  Chris Shouts May 11 '10 at 16:11
1  
Please don't try and avoid firewalls, go through the proper process to get a port opened if you need it for business purposes. –  Zypher Jun 17 '10 at 20:56
add comment

5 Answers 5

If it has a TCP/IP Listening port you can set up an SSH Tunnel to it. You may want to check to see if the port is already in use on your client system first. You can do this with the netstat command On Windows you can run

# netstat -ano

on Linux

# netstat -anut |grep LISTEN

SSH Tunneling can be a little bit difficult to get your head around. With all the diagrams and examples online even I get confused and I use tunnels on a daily basis. I find it best to think about it like this: Your SSH client opens a connection to a server and redirects ports from that network to your *client system creating a listening port for each redirect on your *client system.

-*- The client system is the system you are using the SSH client which may also be referred to as your local system

Sounds like you would like an example of an HTTPS port 443 tunnel!

From a Windows Client System

This example will use the "Putty" client for Windows which can be found on the Putty download site here We'll assume you are running the HTTPS on port 443 on the same system you are running your SSH server. We'll use the Localhost IP address of 127.0.0.1 (127.0.0.1 will always return the system you are logged onto)

From your Putty Window navigate the left column "category" options menu. Expand the "Connection" > "SSH" > "Tunnels" menu. In the "Source port" text field enter 443, in the "Destination" text field enter 127.0.0.1:443 then click the Add button. The "Forwarded Ports" text area will now show "L443 127.0.0.1:443"

alt text

From a Linux Terminal

This should work I didn't test it though....

# ssh -L 443:127.0.0.1:443 <sshuser>@<sshserver ip>

But my SSH server resides on a different Server than my HTTPS Server!

Thats easy replace 127.0.0.1 in the above examples to the IP address your SSH server uses to connect to the HTTPS server!

Gotcha

After configuring the ssh tunnel you can now open the browser on your client machine. Instead of going to the normal IP address port 443 you will use 127.0.0.1 in your local browser.

https://127.0.0.1

Doing this may upset your SSL certificate. In Firefox you will receive the following error message:

alt text Continue through the prompts and allow your cert.

share|improve this answer
add comment

Have you tried it? If not, why not? Why ask a question here if something works when you haven't even tried it? As long as you're only talking about using port 443 to get past some firewalls and not truly tunneling over HTTPS then it should work fine (it's not really clear from your question, you mention both).

share|improve this answer
    
I've tried setting the port to 443 and using it like that, but the firewall ends up blocking it. I'll need to actually tunnel it using HTTPS, but nothing in the documentation for thttpd says how to do this. –  Michael May 11 '10 at 17:55
    
Port 443 == HTTPS If you are trying to make SSH traffic appear to be HTTPS activity that is a whole other ball game. –  David Rickman Jun 18 '10 at 18:16
add comment

I don't know thttpd at all. I barely know lighttpd either.

But if they can serve HTTPS, you could use a tool like SSL Explorer. It can do a lot more than give you SSH access to your network.

Otherwise, these tools may help you :

  • stunnel
  • corkscrew
  • proxytunnel

Some even work with classic HTTP (no need for SSL/TLS).

share|improve this answer
add comment

If you just need to get a terminal to your box, try Ajaxterm

share|improve this answer
add comment

Although Putty would work fine, I would recommend a different option: You can create a nice tunnel (on port 443 obviously and not technically https but maybe good enough) using WinSSHD and Tunnelier as a client.

share|improve this answer
add comment

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.