Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Setup server to connect from anywhere??

  1. #1
    Join Date
    Jul 2010
    Beans
    12

    Setup server to connect from anywhere??

    My ubuntu server is setup as dhcp and i can connect to it from my laptop running ubuntu, so i've been putting files on it, and organizing them. (btw i prefixed this as kubuntu because i installed kubuntu graphical interface)

    I should setup static though right? Once i leave for school and my server is here in this different city will i still be able to connect to it? I was looking at guides for setting up static ip, and the ip I would use is 192.168.0.103 which is how my linksys router had it setup. That only works inside of my house though right? I want to be able to connect to it from school (a different city) so how should I do that?

    I'd also like to be able to connect to it from windows xp as well if possible

    I'm a complete ip noob. lol. Thanks for any help in advance

  2. #2
    Join Date
    Apr 2009
    Location
    Texas
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Setup server to connect from anywhere??

    For starters you should install openssh and use key authentication instead of username and password. Then you need to setup port forwarding through your router and forward port 22 (or whichever you choose to use, 22 is default) to ip that you set for router! IE: port 22 is forwarded to 192.168.0.103. Now let me explain, that address 192.168.0.103 is whats called a private ipaddress. You have a public ip address that the rest of the world sees. So if you go to your router status you should see your public ip which will be something completely different from your private.
    SO.....
    private = 192.168.0.103
    public = 65.345.87.32 (or whatever yours is)

    Once you have ssh and port forwarding setup you will be able to reach your server from anywhere in the world by using the ssh command:

    Code:
    ssh <username>@<public-ip>
    or like this
    Code:
     ssh stlsaint@65.345.87.32
    NOTE: I suggest key authentication if you only intend on connecting from say your laptop that you travel with. If you want to connect from ANY computer you use then you will use username/password which is highly LESS secure than key authentication!!
    Last edited by stlsaint; August 14th, 2010 at 06:36 PM.
    Ubuntu Christian Edition chat on irc at server: OFTC/channel: #ubuntuCE
    BootInfoScript DualBooting
    Grub Grub2 MBR/GRUB
    Boot Info Script courtesy of community member meierfra and ghulselmans

  3. #3
    Join Date
    Apr 2008
    Location
    California Republic
    Beans
    2,657

    Re: Setup server to connect from anywhere??

    hi,

    I was looking at guides for setting up static ip, and the ip I would use is 192.168.0.103 which is how my linksys router had it setup. That only works inside of my house though right? I want to be able to connect to it from school (a different city) so how should I do that?
    only your ISP can give you a static IP address, but there are other workarounds.

    dyndns is what i use. they provide a $0.00 service that allows you to connect to your server even if the IP changes on you. a daemon (ddclient) is installed on the server that notifies dyndns every x minutes of it's current IP address. then, when you want to talk to your server, you use name@dyndnsdomain.com or something similar in place of an IP address.
    Semper Fi

    My Non-Ubuntu Blog.
    All posts by me are Public Domain.

  4. #4
    anewguy is offline I Ubuntu, Therefore, I Am
    Join Date
    Jun 2007
    Location
    Sometimes I visit earth
    Beans
    5,435
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Setup server to connect from anywhere??

    +1 on dyndns. You can't just assume your IP address from your ISP will always be the same - power outages, resets by the ISP, etc., will likely result in a different IP address. You also just can't say "hey - I'm www.hereiam.com" either as these names are controlled.

    So, either use dyndns (you get a name as described above) and connect to your server externally for free, or have your ISP set you up. They would first need to give you an assigned IP address to keep it static. If you want your server known by some URL instead of IP address, you'll also need to get a domain name. Chances are at that point you need to talk to your ISP about a business account as they normally won't let you have your own server without it. Remember that once you open your server up to external connections you will have to take security on your server very seriously.

  5. #5
    Join Date
    Jun 2010
    Beans
    116

    Re: Setup server to connect from anywhere??

    Quote Originally Posted by stlsaint View Post
    ]NOTE: I suggest key authentication if you only intend on connecting from say your laptop that you travel with. If you want to connect from ANY computer you use then you will use username/password which is highly LESS secure than key authentication!!
    I am going to set up my own server and had not thought of using a key but now that you bought it up ... can you save your keys to a USB stick to use from another computer or in my case just to keep them more secure?

    Sorry for venturing a little off topic.

  6. #6
    Join Date
    Jul 2010
    Beans
    12

    Re: Setup server to connect from anywhere??

    @stlsaint
    If I set my router up to portforward to 0.103 will that mess up other internet connections on the router? This isn't a very serious server so if my public ip changes and i have to reconfigure it later on it wont be a big deal. What will be a big deal is if my dad or visitors can't use the internet off that router anymore off their seperate PCs lol.

    @earthpig
    I think i'll just stay with dhcp for now for simplicity. Then if it does become a problem i'll try dyndyn. Thanks!

    @anewguy
    It's just going to be my personal file server that I wont give many other people access to. I won't need a domain (even though i did install LAMP on it)

    Thank you all for your help

  7. #7
    Join Date
    Apr 2009
    Location
    Texas
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Setup server to connect from anywhere??

    Quote Originally Posted by S.R View Post
    I am going to set up my own server and had not thought of using a key but now that you bought it up ... can you save your keys to a USB stick to use from another computer or in my case just to keep them more secure?

    Sorry for venturing a little off topic.
    Yes you can. I save my entire .ssh directory and just copy it over to new systems when needed same ssh settings allowed.
    Ubuntu Christian Edition chat on irc at server: OFTC/channel: #ubuntuCE
    BootInfoScript DualBooting
    Grub Grub2 MBR/GRUB
    Boot Info Script courtesy of community member meierfra and ghulselmans

  8. #8
    Join Date
    Apr 2009
    Location
    Texas
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Setup server to connect from anywhere??

    @stlsaint
    If I set my router up to portforward to 0.103 will that mess up other internet connections on the router? This isn't a very serious server so if my public ip changes and i have to reconfigure it later on it wont be a big deal. What will be a big deal is if my dad or visitors can't use the internet off that router anymore off their seperate PCs lol.
    No it will NOT affect any other user unless they too wish to setup port forwarding through the same port to another ip address. Then its just a simple fix of changing ports that ssh runs through. I have multiple ports going to multiple ip's!
    If you just have other users surfing the net then no it wont hurt their connection!
    Ubuntu Christian Edition chat on irc at server: OFTC/channel: #ubuntuCE
    BootInfoScript DualBooting
    Grub Grub2 MBR/GRUB
    Boot Info Script courtesy of community member meierfra and ghulselmans

  9. #9
    Join Date
    Apr 2009
    Location
    Texas
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Setup server to connect from anywhere??

    Earthpig brings up a good point though. I host a site from home via godaddy so when my ip changes its a big deal for me. For you leaving for school you will have to have someone else who has access to the router to inform you when your ip changes as you wont be able to access the router unless you setup remote management! (which i really DONT suggest you do!)
    So if your public ip changes without you knowing than running that ssh command i gave earlier wont work until you enter the correct ip!
    Ubuntu Christian Edition chat on irc at server: OFTC/channel: #ubuntuCE
    BootInfoScript DualBooting
    Grub Grub2 MBR/GRUB
    Boot Info Script courtesy of community member meierfra and ghulselmans

  10. #10
    Join Date
    Jul 2010
    Beans
    12

    Re: Setup server to connect from anywhere??

    When i try to connect to that ip i get connection refused by server. I think this particular type of port forward up wrong When i enter my public ip into my browser it takes me to my router config page lol.

    @stlsaint
    How often do would my ISP change my public IP address?

    Daily?Weekly? Monthly? Yearly?

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •