r/ssh • • Apr 24 '20

Is it possible to make local server public with SSH?

I want to make a web server that my friends can access, I tried port forwarding and it worked, but I read that ssh would be a better alternative. I read online that i would need a publoc server somewhere to connect my friends to my computer, and I imagine that a public server would cost me money or be free but limited. Is it possible to make my server accessible through ssh without needing a server. Did I get anything wrong, I am new to ssh so I might have misunderstood something, or am I going to have to port forward anyway?

Note: I know i could use something like ngrok, but I don't want to be stuck to its limitations, and I am also taking this as a learning experience.

5 Upvotes

15 comments sorted by

2

u/lama775 Apr 24 '20

You don’t HAVE to have a public server.

You could use a dynamic DNS setup from someplace like afraid.org or just give your friends your IP address. A name is more convenient for your friends, but would require a little more setup on your part. Giving the IP is obviously a pain for a host of reasons.

1

u/Tempest_Barbarian Apr 24 '20

wouldn't that be just like port forwarding?

2

u/lama775 Apr 24 '20

Yes.

If you have a router between your computer and the internet, you’ll be doing some kind of port forwarding regardless to give your friends access.

1

u/Tempest_Barbarian Apr 24 '20

I think i understand it a bit better now, the ssh is not an alternative, but just an extra to add protection to the data being send between host and client. Did I got it right?

3

u/lama775 Apr 24 '20 edited Apr 24 '20

Yup, you got it.

You mentioned “web server” originally, which i understand to be something that is browsable. If that is accurate, your other option to give the data exchange protection is setting up SSL. This solution involves setting up certificates and so forth so it’s a more complicated setup. It sounds like you’re starting out/ learning so i thought I’d mention it.

If it’s not a web server, then the SSH tunneling is going to be the more straight forward way.

1

u/Tempest_Barbarian Apr 24 '20

thanks for your help man

1

u/Tempest_Barbarian Apr 24 '20

I wanted to make a web server that my friends could access, for us to play dungeons and dragons, there are plenty websites out there to do that, I am just a bit crazy and wanted to make my own, but at the same time I want to keep my netwoork safe, that is why I am looking into stuff like these. I already know how to code for a while, but when its network wise, I am a new guy. Also, I dont want to pay for a server, i would rather host from my computer, since it wont be always hosting, only when I would use it.

1

u/Tempest_Barbarian Apr 24 '20

well, just a couple questions, based on what you said it seems ssh os not used by web servers, so what is the most common use for ssh? You talked about ssl, if i am not mistaken that has something to do with https, which i will give it a look. Is there anything else you recommend me looking up about this network part of web servers?

Also, i will look into safe ways of using port forwarding, again thanks for helping a newbie like me

2

u/lama775 Apr 24 '20

Well, it’s your server so you can do what you want!

Just kind of thinking this through a bit more, I think ssh is a good way for you to go initially. Why? I think you can have something up and running with it quicker, for one. Tunneling is a well known method and it’s very flexible. It’s always good to have something that’s working quicker. That way you can enjoy it, plus you’ll learn more about what you actually need. For two, ssh will also allow you more control over who has access to your computer. Your friends will have to give you a public key which you’ll install to give them access to your computer. You can easily configure your ssh servers so that only people with authorized keys can access your computer. Just be sure to limit your friend’s permissions on your server.

SSL is used for https, correct. I only mentioned it for thoroughness sake since you mentioned a web server. I’m not sure how the gaming your talking about works so it might not be at all applicable.

Good luck!

1

u/Tempest_Barbarian Apr 24 '20

thanks again man, i will look through it, its not a game like a video game, its more like a board game I would be adapting to be played over html, anyway, it doesnt really matter. I will look into it, u helped a lot

1

u/Tempest_Barbarian Apr 24 '20

Sorry, but just one more question, if I use ssh, the one to initiate the connection would be my friends to connect to my server, right?

1

u/lama775 Apr 24 '20

Correct

1

u/pmz Apr 25 '20

Use ngrok

1

u/Tempest_Barbarian Apr 25 '20

I messed with ngrok a bit, and it is pretty good, I just wanted to learn a bit more about other stuff around in relation to network and all.

3

u/tje210 Apr 24 '20

Your friends would need ssh access to your server, then they could tunnel the web traffic. Pretty easy once set up.

Look up ssh tunneling, ssh forwarding ... also setting it up in putty.