How to use ssh over http or https?

What is possible depends on what the firewall allows.

If the firewall allows arbitrary traffic on port 443

Some firewalls take the simple way out and allow anything on port 443. If that's the case, the easiest way to reach your home server is to make it listen to SSH connections on port 443. If your machine is directly connected to the Internet, simply add Port 443 to /etc/ssh/sshd_config or /etc/sshd_config just below the line that says Port 22. If your machine is behind a router/firewall that redirects incoming connections, make it redirect incoming connections to port 443 to your server's port 22 with something like

iptables -t nat -I PREROUTING -p tcp -i wan0 --dport 443 -j DNAT --to-destination

where wan0 is the WAN interface on your router and is your server's IP address on your home network.

If you want to allow your home server to listen both to HTTPS connections and SSH connections on port 443, it's possible — SSH and HTTPS traffic can easily be distinguished (in SSH, the server talks first, whereas in HTTP and HTTPS, the client talks first). See and for tutorials on how to set this up with sshttp, and also Have SSH on port 80 or 443 while webserver (nginx) is running on these ports

If you have a web proxy that allows CONNECT tunnelling

Some firewalls block all outgoing connections, but allow browsing the web via a proxy that allows the HTTP CONNECT method to effectively pierce a hole in the firewall. The CONNECT method may be restricted to certain ports, so you may need to combine this with listening on port 443 as above.

To make SSH go via the proxy, you can use a tool like corkscrew. In your ~/.ssh/config, add a ProxyCommand line like the one below, if your web proxy is

Host home
ProxyCommand corkscrew 3128 %h %p

Wrapping SSH in HTTP(S)

Some firewalls don't allow SSH traffic, even on port 443. To cope with these, you need to disguise or tunnel SSH into something that the firewall lets through. See for a tutorial on doing this with proxytunnel.

You can use sslh if you want to run BOTH an HTTPS server and an SSHd server on the same port 443.

you can try another way, set up a web server, which can ssh your server,