Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
Hi I have a dsl connection with a static IP and my linux box connects to the internet via dhcp. I would like to access my pc remotely via ssh. ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2005
    Posts
    5

    ssh server for remote access


    Hi

    I have a dsl connection with a static IP and my linux box connects to the internet via dhcp. I would like to access my pc remotely via ssh. I am not entirely sure how to use my static IP to access my pc which has a local ip of 192.168.1.103.
    any help would be appreciated.

    thanks

  2. #2
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    Location
    St. Petersburg, FL
    Posts
    5,035
    I suggest a program called OpenSSH. It's relatively intuitive and easy to configure/customize and very powerful.

  3. #3
    Just Joined!
    Join Date
    Feb 2005
    Posts
    5
    I have sshd running on my machine.

  4. #4
    Linux Engineer adrenaline's Avatar
    Join Date
    Aug 2004
    Location
    Seattle, Washington
    Posts
    1,058
    You need to port forward port 22 to your linux box in your router. then when you are remote you type ssh -l <username> IP of router
    ssh -l jbloe 63.145.113.87 #ip is made up for example
    in your router there should be a port forward section or port trigger
    22 tcp ssh 192.168.1.103 enable
    apply
    That should be all it takes
    Let me know if this is not clear
    Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
    -- Linus Torvalds

  5. #5
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    Location
    St. Petersburg, FL
    Posts
    5,035
    Well you'll have to configure your Router to forward packets on port 20 (or whatever port you're running SSH on) to 192.168.1.103. This method varies from router to router. Which model do you have? This should be in any documentation which came with the router, or check online.

  6. #6
    Linux Guru kkubasik's Avatar
    Join Date
    Mar 2004
    Location
    Lat: 39:03:51N Lon: 77:14:37W
    Posts
    2,396
    Most routers provide a webaccessable interface. Your routers IP is most likely

    192.168.0.1
    192.168.1.1
    192.168.100.1
    10.0.10.1
    10.0.10.10

    try typing those addresses into a web browser to dig up an interface for your router. The manufactuers site would most definatly have more information on that though. Make sure that you forword both UDPand TCP connections, the new ssh2 protocol its cool with TCP only, but some of the much older ones still attempt UDP first i believe. Just should login's take a while, then try adding UDP.
    Avoid the Gates of Hell. Use Linux
    A Penny for your Thoughts

    Formerly Known as qub333

  7. #7
    Just Joined!
    Join Date
    Feb 2005
    Posts
    5
    thanks guys. I've got it working...

  8. #8
    Linux Newbie
    Join Date
    Nov 2004
    Location
    New York
    Posts
    150
    Quick question, if I can hijack this thread for a sec . If I have a linux box that uses DHCP for the router, will the port forwarding still automatically work if the box changes ips? That is, does the router remember what hardware address gets what packet, or does it go by ip alone? I'll probably end up switching to a static ip within the network anyway, but I'm really curious about this.
    \"Nifty News Fifty: When news breaks, we give you the pieces.\" - Sluggy Freelance

  9. #9
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    Location
    St. Petersburg, FL
    Posts
    5,035
    I'm pretty sure that it goes by IP. But you can set up all good routers/DHCP servers to bind certain IPs to certain MACs

  10. #10
    Linux Engineer adrenaline's Avatar
    Join Date
    Aug 2004
    Location
    Seattle, Washington
    Posts
    1,058
    Quote Originally Posted by Workaphobia
    Quick question, if I can hijack this thread for a sec . If I have a linux box that uses DHCP for the router, will the port forwarding still automatically work if the box changes ips? That is, does the router remember what hardware address gets what packet, or does it go by ip alone? I'll probably end up switching to a static ip within the network anyway, but I'm really curious about this.
    If you are going to port forward you will need to have a static IP. The forwarding is configured hard to that IP address. It won't know where to go if it got dhcp'd some other address.
    Make sense?
    Mike
    Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
    -- Linus Torvalds

Page 1 of 2 1 2 LastLast

Posting Permissions

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