# access a command line via a web browser

2 questions:

Question 1
My job blocks ssh which means that I cannot ssh to my home server. However, they do allow https out. Is there a package out there for ubuntu that will allow me to connect to the command line via https? I already have apache installed and can install additional software if needed.

Question 2
We use Samba at home on our ubuntu server (same server as in question 1). How do I configure it so that a) password change on a regular interval and b) when its time to change the password, windows (7 in this case) will display a pop-up window asking the user to change the password. Note: to connect to the server, I created a batch file which uses "net use" commands.

thanks,
frank

-
You should separate this into two questions. –  goldilocks Mar 13 '13 at 19:41

WRT question 1:

What they've (almost certainly) actually blocked is just outgoing traffic on the normal ssh port, 22, but (obviously) they allow traffic out on the normal http port, 80.

However, the ssh server doesn't have to use port 22, just like http servers don't have to use port 80. It's just convention, which saves normal users from having to think about port numbers. So the first thing you should try is to set up sshd at home configured to use port 80 instead of port 22, which is a matter of adding:

Port 80


To /etc/ssh/sshd_config. See also man sshd_config. The ssh client also uses port 22 by default -- but you can specify a different one with the -p switch, eg, ssh -p 80 .... Note that some of the other ssh tools (eg, scp) (ridiculously enough) use -P instead of -p. Many other tools (including web browsers) will allow you to specify the port as port as part of the address, eg, ssh://me@there:80.

Presuming you get to use your own computer at work or otherwise have access to an ssh client, that should solve the problem.

You could also use port 443, the normal https (note the 's' for secure) port, since you can probably use https at work as well (therefore, it is not blocked by your firewall). While most ports numbers have specific services conventionally associated with them, they are all functionally identical (although lower numbers on *nix require root privileges to open, including 22, 80, and 443).

-
Since I am using port 80 for http on my home server, I think that port should not be used. However, port 8022 should be wide open. So just add: Port 8022 to /etc/ssh/sshd_config? –  user33814 Mar 13 '13 at 19:42
Sure, if 8022 is open from work; the destination port is specified in the IP header and that's what the firewall filters. Chances are they have only left open ports that are recognized as necessary, such as 80 and 443. However, 8080 is probably open too (since web servers sometimes use it) and 21, which is FTP. No doubt there are others (there may be various ones for mail, etc). I guess you could just ask whoever's in charge of the firewall which ports are open. –  goldilocks Mar 13 '13 at 19:46
There's a list of port numbers and their conventional associations in /etc/services, btw. –  goldilocks Mar 13 '13 at 19:48
Thanks for your input so far. Very helpful. One more question: I have a router in front of my home network. I could just easily add a "port forward" to the router from say, 8080 to 22 (on my server). Then I should not need to modify anything on my server. Then the port for putty would be 8080 and the "host name" would be my WAN ip address on the router. That should work, right? –  user33814 Mar 13 '13 at 19:51
I would think it should, yep. –  goldilocks Mar 13 '13 at 19:54