If I run a hidden service on a computer that has a public ip adress and ssh into it, could I connect to the regular internet or all my outbound connections can just be into the tor network ?
A hidden service does not route all the other traffic on the computer through tor. To do that you need transparent proxying on the server. So - if you set up a server with tor, create a regular hidden service on port 80, then ssh into it through public IP then do any web requests and such on the server then it will be routed through the regular Internet connection.
All the traffic to\from the tor hidden service port is routed through tor if configured properly.
Also - keep in mind that if the port 80 is bound to anything else then 'localhost' then the hidden web service could be reached through the public ip on the server.
Yes, all three cases :
- Can a HS(Hidden Service) itself connect to clearnet - Yes, in your case it can. Tor is just a transport layer, so after it has forwarded your query to the HS port - like STunnel - Tor's job is done. And if there's a clearnet exit and no firewall rules prohibition - the server implementing the HS service itself can connect to clearnet just like usual.
- Can a HS be your tunnel to clearnet if you've connected to it through Tor - Sure! Use OpenVPN in TCP mode, put the VPN server's port as a HS provided via Tor, and release the whole traffic to and/or from clearnet from the host your HS VPN server running at.
- Can all the outbound connections be served via Tor - Just a firewall magic : route all the traffic except SSH and Tor via TransPort of Tor. Ssh and tor services' traffic is better separated by user ID/name in iptables at least.
You can use your computer in a way like you were sitting directly in front of it. What does this mean for your setup? You connect to your computer via Tor and your computer is set up in a a way that all outbound connections are done without Tor. When you now open a connection from your computer to some other website, chat or anything else, this is done without Tor.