Skip to content

Latest commit

 

History

History
35 lines (24 loc) · 1.89 KB

mobile-server.md

File metadata and controls

35 lines (24 loc) · 1.89 KB

mobile server

introduction

mobile internet connection doesn't allow INPUT connection due the fact your public ip is shared with other and all outgoing traffic is natted by the provider. sometimes may happen you have only a mobile connection and need to serve an http, https service directly from your computer. there are two problems:

  • have a INPUT connection
  • sign your letsencrypt https certificate

all of these solve by buying a basic online server, personally I found comfortable with DigitalOcean droplets ones: for a 1cpu, 25GB ssd disk ( montly cost equiparable to have 1 static ip address from service provider )

enable INPUT connections

  • on the online server set sshd_config
    • to allow GatewayPorts yes to allow bind of non-local addresses through reverse ssh
    • to maintain ssh keep alive ClientAliveInterval 120 and ClientAliveCountMax 252800 ( 365 days )
    • then restart ssh sevice
  • connects through ssh tunnel your 80,443 services
    • ssh -R 80:10.10.0.18:80 -R 443:10.10.0.18:443 online
    • where 10.10.0.18 for example is your local nginx server and online is the name of your online server configured into ~/.ssh/config

sign letsencrypt https certificate

  • connects the online server so that local 80,443 ports exports there to allow letsencrypt validate certs
ssh -R 80:127.0.0.1:80 -R 443:127.0.0.1:443 online

opportunity and security considerations

someone will ask himself if having an online server isn't already enough to serve required service creating an https certs from there, the answer is yes, but, if paranoid you want data flows through an https encryption to/from your local disk with a certificate which private key is in your local server, thus the above procedure.